Spaces:
Running
Running
Upload 15 files
Browse files- .gitattributes +1 -0
- solar-farmville-master/.floo +3 -0
- solar-farmville-master/.flooignore +8 -0
- solar-farmville-master/css/.subl952.tmp +85 -0
- solar-farmville-master/css/styles.css +131 -0
- solar-farmville-master/css/styles.css~RF230c85d.TMP +0 -0
- solar-farmville-master/img/Thumbs.db +0 -0
- solar-farmville-master/img/background.png +3 -0
- solar-farmville-master/img/logo.png +0 -0
- solar-farmville-master/img/nuclear.png +0 -0
- solar-farmville-master/img/oil.png +0 -0
- solar-farmville-master/img/solar.png +0 -0
- solar-farmville-master/img/wind.png +0 -0
- solar-farmville-master/index.html +234 -0
- solar-farmville-master/js/main.js +356 -0
- solar-farmville-master/links +1 -0
.gitattributes
CHANGED
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
36 |
+
solar-farmville-master/img/background.png filter=lfs diff=lfs merge=lfs -text
|
solar-farmville-master/.floo
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
{
|
2 |
+
"url": "https://floobits.com/bradman/Solar-Farmville"
|
3 |
+
}
|
solar-farmville-master/.flooignore
ADDED
@@ -0,0 +1,8 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
#*
|
2 |
+
*.o
|
3 |
+
*.pyc
|
4 |
+
*~
|
5 |
+
extern/
|
6 |
+
node_modules/
|
7 |
+
tmp
|
8 |
+
vendor/
|
solar-farmville-master/css/.subl952.tmp
ADDED
@@ -0,0 +1,85 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
.game-container {
|
2 |
+
position: relative;
|
3 |
+
max-width: 1200px;
|
4 |
+
height: 900px;
|
5 |
+
border: 2px solid #ddd;
|
6 |
+
}
|
7 |
+
|
8 |
+
.grid {
|
9 |
+
margin-top: 40%;
|
10 |
+
width: 45%;
|
11 |
+
margin: 0 auto;
|
12 |
+
}
|
13 |
+
|
14 |
+
.block {
|
15 |
+
height: 100px;
|
16 |
+
border: 2px solid #ddd;
|
17 |
+
background-image: url(http://previewcf.turbosquid.com/Preview/2014/08/01__17_56_46/grass_tex.jpgb91b8892-a3aa-4b03-bde2-0be3478eae61Larger.jpg);
|
18 |
+
}
|
19 |
+
|
20 |
+
.block:hover {
|
21 |
+
cursor: pointer;
|
22 |
+
}
|
23 |
+
|
24 |
+
.status {
|
25 |
+
position: absolute;
|
26 |
+
top: 0;
|
27 |
+
right: 0;
|
28 |
+
width: 30%;
|
29 |
+
border: 2px solid #000;
|
30 |
+
}
|
31 |
+
|
32 |
+
.progress {
|
33 |
+
margin-bottom: 10px;
|
34 |
+
}
|
35 |
+
|
36 |
+
.money-amount {
|
37 |
+
margin-bottom: 10px;
|
38 |
+
}
|
39 |
+
|
40 |
+
.popup {
|
41 |
+
display: none;
|
42 |
+
position: absolute;
|
43 |
+
width: 50%;
|
44 |
+
top: 20%;
|
45 |
+
left:0;
|
46 |
+
right:0;
|
47 |
+
margin-left:auto;
|
48 |
+
margin-right:auto;
|
49 |
+
padding: 20px;
|
50 |
+
z-index: 5;
|
51 |
+
background: #fff;
|
52 |
+
border: 2px solid #ddd;
|
53 |
+
box-shadow: 0 5px 15px rgba(0,0,0,.5);
|
54 |
+
}
|
55 |
+
|
56 |
+
.popup .escape-container {
|
57 |
+
float: left;
|
58 |
+
cursor: pointer;
|
59 |
+
}
|
60 |
+
|
61 |
+
.btn-buy {
|
62 |
+
display: block;
|
63 |
+
margin: 0 auto;
|
64 |
+
}
|
65 |
+
|
66 |
+
.img-block-type {
|
67 |
+
|
68 |
+
}
|
69 |
+
|
70 |
+
.energy-img {
|
71 |
+
height: 100%;
|
72 |
+
}
|
73 |
+
|
74 |
+
.btn-nextMonth {
|
75 |
+
display:block;
|
76 |
+
margin: 0 auto;
|
77 |
+
}
|
78 |
+
|
79 |
+
.logo {
|
80 |
+
margin-top:2%;
|
81 |
+
margin-left:5%;
|
82 |
+
max-height: 20%;
|
83 |
+
max-width: 20%;
|
84 |
+
margin-bottom: 10%;
|
85 |
+
}
|
solar-farmville-master/css/styles.css
ADDED
@@ -0,0 +1,131 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
body{
|
2 |
+
background-image: url('../img/background.png');
|
3 |
+
font-family: 'Roboto', sans-serif;
|
4 |
+
}
|
5 |
+
.game-container {
|
6 |
+
position: relative;
|
7 |
+
max-width: 1200px;
|
8 |
+
max-height: 900px;
|
9 |
+
}
|
10 |
+
|
11 |
+
.grid {
|
12 |
+
margin-top: 40%;
|
13 |
+
width: 45%;
|
14 |
+
margin: 0 auto;
|
15 |
+
transition: webkit-transform .5s, transform .5s;
|
16 |
+
/*-webkit-transform: matrix3d(0.981576352, 0.0274439393, 0.1890891206, 0, -0.1703885647, 0.5735455435, 0.8012572908, 0, -0.0864615659, -0.8187138325, 0.5676548759, 0, 0, 0, 0, 1);
|
17 |
+
-webkit-transform-style: preserve-3d;*/
|
18 |
+
}
|
19 |
+
|
20 |
+
.block {
|
21 |
+
height: 160px;
|
22 |
+
border: 2px solid #ddd;
|
23 |
+
background-image: url(http://previewcf.turbosquid.com/Preview/2014/08/01__17_56_46/grass_tex.jpgb91b8892-a3aa-4b03-bde2-0be3478eae61Larger.jpg);
|
24 |
+
}
|
25 |
+
|
26 |
+
.block:hover {
|
27 |
+
cursor: pointer;
|
28 |
+
}
|
29 |
+
|
30 |
+
.status {
|
31 |
+
position: absolute;
|
32 |
+
top: 0;
|
33 |
+
right: 0;
|
34 |
+
width: 30%;
|
35 |
+
border: 2px solid #000;
|
36 |
+
background-color:rgba(33,33,33,0.3);
|
37 |
+
}
|
38 |
+
|
39 |
+
.progress {
|
40 |
+
margin-bottom: 10px;
|
41 |
+
}
|
42 |
+
|
43 |
+
.waste-bar {
|
44 |
+
text-align: center;
|
45 |
+
color: #000;
|
46 |
+
}
|
47 |
+
|
48 |
+
.money-amount {
|
49 |
+
margin-bottom: 10px;
|
50 |
+
}
|
51 |
+
|
52 |
+
.popup {
|
53 |
+
display: none;
|
54 |
+
position: absolute;
|
55 |
+
width: 50%;
|
56 |
+
top: 20%;
|
57 |
+
left:0;
|
58 |
+
right:0;
|
59 |
+
margin-left:auto;
|
60 |
+
margin-right:auto;
|
61 |
+
padding: 20px;
|
62 |
+
z-index: 5;
|
63 |
+
background: #fff;
|
64 |
+
border: 2px solid #ddd;
|
65 |
+
box-shadow: 0 5px 15px rgba(0,0,0,.5);
|
66 |
+
|
67 |
+
}
|
68 |
+
|
69 |
+
.popup .escape-container {
|
70 |
+
float: left;
|
71 |
+
cursor: pointer;
|
72 |
+
}
|
73 |
+
|
74 |
+
.btn-buy {
|
75 |
+
display: block;
|
76 |
+
margin: 0 auto;
|
77 |
+
}
|
78 |
+
|
79 |
+
.img-block-type {
|
80 |
+
|
81 |
+
}
|
82 |
+
|
83 |
+
.energy-img {
|
84 |
+
max-height: 100%;
|
85 |
+
}
|
86 |
+
|
87 |
+
.btn-next-year {
|
88 |
+
display:block;
|
89 |
+
margin: 0 auto;
|
90 |
+
margin-top: 40px;
|
91 |
+
}
|
92 |
+
|
93 |
+
.logo {
|
94 |
+
margin-top:2%;
|
95 |
+
margin-left:5%;
|
96 |
+
max-height: 20%;
|
97 |
+
max-width: 20%;
|
98 |
+
margin-bottom: 10%;
|
99 |
+
}
|
100 |
+
/*.top{
|
101 |
+
background-color:rgba(33,33,33,0.7);
|
102 |
+
}*/
|
103 |
+
.money-title, .green{
|
104 |
+
color:#1AED3A;
|
105 |
+
}
|
106 |
+
.waste-title, .red{
|
107 |
+
color:#ED1A4B;
|
108 |
+
}
|
109 |
+
.orange{
|
110 |
+
color:#E78624;
|
111 |
+
}
|
112 |
+
.blue{
|
113 |
+
color:#3BBDEE;
|
114 |
+
}
|
115 |
+
.year-title,.year-number{
|
116 |
+
color:#38BFEF;
|
117 |
+
}
|
118 |
+
.titlescreen .col-centered {
|
119 |
+
float: none;
|
120 |
+
text-align: center;
|
121 |
+
margin: 0 auto;
|
122 |
+
}
|
123 |
+
.btn-start {
|
124 |
+
margin-top: 20px;
|
125 |
+
}
|
126 |
+
.version-text {
|
127 |
+
display: none;
|
128 |
+
position: absolute;
|
129 |
+
font-weight: bold;
|
130 |
+
font-size: 1.2em;
|
131 |
+
}
|
solar-farmville-master/css/styles.css~RF230c85d.TMP
ADDED
File without changes
|
solar-farmville-master/img/Thumbs.db
ADDED
Binary file (86 kB). View file
|
|
solar-farmville-master/img/background.png
ADDED
Git LFS Details
|
solar-farmville-master/img/logo.png
ADDED
solar-farmville-master/img/nuclear.png
ADDED
solar-farmville-master/img/oil.png
ADDED
solar-farmville-master/img/solar.png
ADDED
solar-farmville-master/img/wind.png
ADDED
solar-farmville-master/index.html
ADDED
@@ -0,0 +1,234 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
<!DOCTYPE html>
|
2 |
+
<html>
|
3 |
+
<head>
|
4 |
+
<title>
|
5 |
+
Solar Farmville
|
6 |
+
</title>
|
7 |
+
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap.min.css">
|
8 |
+
<link rel="stylesheet" type="text/css" href="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/css/bootstrap-theme.min.css">
|
9 |
+
<link rel="stylesheet" type="text/css" href="https://cdnjs.cloudflare.com/ajax/libs/normalize/3.0.1/normalize.min.css">
|
10 |
+
<link href='http://fonts.googleapis.com/css?family=Roboto' rel='stylesheet' type='text/css'>
|
11 |
+
<link rel="stylesheet" type="text/css" href="css/styles.css">
|
12 |
+
</head>
|
13 |
+
|
14 |
+
<body>
|
15 |
+
<div class="game-container container-fluid">
|
16 |
+
<div class="top container">
|
17 |
+
<div class="logo-container">
|
18 |
+
<img class="logo" src="img/logo.png" alt="">
|
19 |
+
</div>
|
20 |
+
<div class="status container">
|
21 |
+
<div class="money-container">
|
22 |
+
<p class="money-title">Money</p>
|
23 |
+
<div class="progress">
|
24 |
+
<div class="money-bar progress-bar progress-bar-success progress-bar-striped active money-amount" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%">
|
25 |
+
$1000
|
26 |
+
</div>
|
27 |
+
</div>
|
28 |
+
</div>
|
29 |
+
<div class="waste-container">
|
30 |
+
<p class="waste-title">Waste</p>
|
31 |
+
<div class="progress">
|
32 |
+
<div class="waste-bar progress-bar progress-bar-danger progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:0%">
|
33 |
+
0%
|
34 |
+
</div>
|
35 |
+
</div>
|
36 |
+
</div>
|
37 |
+
<div>
|
38 |
+
<p class="year-title">
|
39 |
+
Year
|
40 |
+
</p>
|
41 |
+
<div class="year-number">
|
42 |
+
|
43 |
+
</div>
|
44 |
+
</div>
|
45 |
+
</div>
|
46 |
+
</div><!-- end of .top.container -->
|
47 |
+
<div class="titlescreen popup">
|
48 |
+
<div class="row">
|
49 |
+
<div class="col-sm-6 col-centered">
|
50 |
+
<img class="titleLogo img-responsive" src="img/logo.png">
|
51 |
+
<button class="btn btn-primary btn-start text-center" type="button">Start</button>
|
52 |
+
<h3>Instructions</h3>
|
53 |
+
<p><span><h4 class="red">Goal:</h4></span> Get as much money as possible without polluting the planet.</p>
|
54 |
+
<p><span><h4 class="orange">How to get money?</h4></span>Build and upgrade buildings.</p>
|
55 |
+
<p><span><h4 class="blue">How to get rid of waste?</h4></span> Spend money to remove waste at the end of each year.</p>
|
56 |
+
</div>
|
57 |
+
|
58 |
+
</div>
|
59 |
+
</div>
|
60 |
+
<div class="grid">
|
61 |
+
<div class="row">
|
62 |
+
<div class="block col-sm-4 block-1" data-block="0">
|
63 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
64 |
+
<img class="energy-img">
|
65 |
+
</div>
|
66 |
+
<div class="block col-sm-4 block-2" data-block="1">
|
67 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
68 |
+
<img class="energy-img">
|
69 |
+
</div>
|
70 |
+
<div class="block col-sm-4 block-3" data-block="2">
|
71 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
72 |
+
<img class="energy-img">
|
73 |
+
</div>
|
74 |
+
</div>
|
75 |
+
<div class="row">
|
76 |
+
<div class="block col-sm-4 block-4" data-block="3">
|
77 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
78 |
+
<img class="energy-img">
|
79 |
+
</div>
|
80 |
+
<div class="block col-sm-4 block-5" data-block="4">
|
81 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
82 |
+
<img class="energy-img">
|
83 |
+
</div>
|
84 |
+
<div class="block col-sm-4 block-6" data-block="5">
|
85 |
+
<div class="version-text" data-version="1"> Version 1</div>
|
86 |
+
<img class="energy-img">
|
87 |
+
</div>
|
88 |
+
</div>
|
89 |
+
</div><!-- end of .grid -->
|
90 |
+
<button type="button" class="btn btn-primary btn-next-year">Next Year</button>
|
91 |
+
<div class="popup buy-menu">
|
92 |
+
<div class="escape-container">
|
93 |
+
<span class="glyphicon glyphicon-remove"></span>
|
94 |
+
</div>
|
95 |
+
<h2 class="blue">Choose energy source to build:</h2>
|
96 |
+
<div class="row">
|
97 |
+
<div class="col-sm-3">
|
98 |
+
<h2>Oil</h2>
|
99 |
+
<img class="img-responsive img-block-type"src="img/oil.png" alt="">
|
100 |
+
<div class="text-center">
|
101 |
+
<p class="green">+$100/Year</p>
|
102 |
+
<p class="red">+15% Waste/Year</p>
|
103 |
+
</div>
|
104 |
+
|
105 |
+
<button type="button" class="btn btn-primary oil btn-buy" data-buy="oil">
|
106 |
+
<span class="glyphicon glyphicon-usd"></span>
|
107 |
+
100
|
108 |
+
</button>
|
109 |
+
</div>
|
110 |
+
<div class="col-sm-3">
|
111 |
+
<h2>Solar</h2>
|
112 |
+
<img class="img-responsive img-block-type"src="img/solar.png" alt="">
|
113 |
+
<div class="text-center">
|
114 |
+
<p class="green">+$250/Year</p>
|
115 |
+
<p class="red">+5% Waste/Year</p>
|
116 |
+
</div>
|
117 |
+
<button type="button" class="btn btn-primary btn-buy" data-buy="solar">
|
118 |
+
<span class="glyphicon glyphicon-usd"></span>500
|
119 |
+
</button>
|
120 |
+
</div>
|
121 |
+
<div class="col-sm-3">
|
122 |
+
<h2>Wind</h2>
|
123 |
+
<img class="img-responsive img-block-type" src="img/wind.png" alt="">
|
124 |
+
<div class="text-center">
|
125 |
+
<p class="green">+$500/Year</p>
|
126 |
+
<p class="red">+5% Waste/Year</p>
|
127 |
+
</div>
|
128 |
+
<button type="button" class="btn btn-primary btn-buy" data-buy="wind">
|
129 |
+
<span class="glyphicon glyphicon-usd"></span>1500
|
130 |
+
</button>
|
131 |
+
</div>
|
132 |
+
<div class="col-sm-3">
|
133 |
+
<h2>Nuclear</h2>
|
134 |
+
<img class="img-responsive img-block-type" src="img/nuclear.png" alt="">
|
135 |
+
<div class="text-center">
|
136 |
+
<p class="green">+$1500/Year</p>
|
137 |
+
<p class="red">+15%/Year</p>
|
138 |
+
</div>
|
139 |
+
<button type="button" class="btn btn-primary btn-buy" data-buy="nuclear">
|
140 |
+
<span class="glyphicon glyphicon-usd"></span>2500
|
141 |
+
</button>
|
142 |
+
</div>
|
143 |
+
</div>
|
144 |
+
</div><!-- end of .buy-menu -->
|
145 |
+
<div class="popup upgrade-menu">
|
146 |
+
<div class="escape-container">
|
147 |
+
<span class="glyphicon glyphicon-remove"></span>
|
148 |
+
</div>
|
149 |
+
<h2 class="text-center">Upgrades</h2>
|
150 |
+
<div class="row">
|
151 |
+
<div class="col-sm-3 version" data-version="1">
|
152 |
+
<h3>Version 1</h1>
|
153 |
+
<img class="img-responsive img-block-type"src="img/oil.png" alt="">
|
154 |
+
<div class="text-center">
|
155 |
+
<p class="green">+Current Price/Year</p>
|
156 |
+
<p class="red">+Current Price/Year</p>
|
157 |
+
</div>
|
158 |
+
<button type="button" class="btn btn-primary oil btn-upgrade" data-upgrade="1">
|
159 |
+
<span class="glyphicon glyphicon-usd"></span>
|
160 |
+
Buy
|
161 |
+
</button>
|
162 |
+
</div>
|
163 |
+
<div class="col-sm-3 version" data-version="2">
|
164 |
+
<h3>Version 2</h1>
|
165 |
+
<img class="img-responsive img-block-type"src="img/solar.png" alt="">
|
166 |
+
<div class="text-center">
|
167 |
+
<p class="green">+$150/Year</p>
|
168 |
+
<p class="red">+0%/Year</p>
|
169 |
+
</div>
|
170 |
+
<button type="button" class="btn btn-primary btn-upgrade" data-upgrade="2">
|
171 |
+
<span class="glyphicon glyphicon-usd">1000</span>
|
172 |
+
</button>
|
173 |
+
</div>
|
174 |
+
<div class="col-sm-3 version" data-version="3">
|
175 |
+
<h3>Version 3</h1>
|
176 |
+
<img class="img-responsive img-block-type" src="img/wind.png" alt="">
|
177 |
+
<div class="text-center">
|
178 |
+
<p class="green">+$200/Year</p>
|
179 |
+
<p class="red">+0%/Year</p>
|
180 |
+
<p class="price"></p>
|
181 |
+
</div>
|
182 |
+
<button type="button" class="btn btn-primary btn-upgrade" data-upgrade="3">
|
183 |
+
<span class="glyphicon glyphicon-usd">3000</span>
|
184 |
+
</button>
|
185 |
+
</div>
|
186 |
+
<div class="col-sm-3 remove">
|
187 |
+
<h3>Remove Building</h3>
|
188 |
+
<button class="btn btn-warning btn-remove">Remove</button>
|
189 |
+
|
190 |
+
</div>
|
191 |
+
</div>
|
192 |
+
</div>
|
193 |
+
<div class="popup gameover">
|
194 |
+
<h2 class="text-center">Game Over</h2>
|
195 |
+
<p class="gameover-score">Your score is: <p>
|
196 |
+
<div class="progress">
|
197 |
+
<div class="money-amount money-bar progress-bar progress-bar-success progress-bar-striped active" role="progressbar" aria-valuenow="100" aria-valuemin="0" aria-valuemax="100" style="width:100%">
|
198 |
+
$250
|
199 |
+
</div>
|
200 |
+
</div>
|
201 |
+
<p class="year-title">
|
202 |
+
You survived for <span class="yearnum"></span> years from 2014 - <span class="year-number"></span>
|
203 |
+
</p>
|
204 |
+
|
205 |
+
<div class="row gameover-btns">
|
206 |
+
<div class="col-sm-3">
|
207 |
+
<button type="button" class="btn btn-primary btn-again">Play Again?</button>
|
208 |
+
</div>
|
209 |
+
<div class="col-sm-3">
|
210 |
+
<button type="button" class="btn btn-primary btn-menu">Back to Menu</button>
|
211 |
+
</div>
|
212 |
+
</div>
|
213 |
+
</div><!-- end of .gameover -->
|
214 |
+
<div class="popup year-report">
|
215 |
+
<div class="escape-container">
|
216 |
+
<span class="glyphicon glyphicon-remove"></span>
|
217 |
+
</div>
|
218 |
+
<div class="fact">
|
219 |
+
<h2 class="fact-title">SMUD Fact of the Year</h2>
|
220 |
+
<p class="fact-text"></p>
|
221 |
+
</div>
|
222 |
+
<h3 class="green">Money Gained $<span class="year-gain"></span></h3>
|
223 |
+
<h3 class="red">Waste Gained <span class="year-waste"></span></h3>
|
224 |
+
|
225 |
+
<button class="btn btn-danger remove-waste-25-btn" data-waste="25">Remove 25% Waste for <span class="remove-waste-25"></span> </button>
|
226 |
+
<button class="btn btn-danger remove-waste-50-btn" data-waste="50">Remove 50% Waste for <span class="remove-waste-50"></span></button>
|
227 |
+
<button class="btn btn-primary btn-next">Continue</button>
|
228 |
+
</div>
|
229 |
+
</div><!-- end of .game-container -->
|
230 |
+
<script src="https://code.jquery.com/jquery-1.11.0.min.js"></script>
|
231 |
+
<script src="https://maxcdn.bootstrapcdn.com/bootstrap/3.2.0/js/bootstrap.min.js"></script>
|
232 |
+
<script type="text/javascript" src="js/main.js"></script>
|
233 |
+
</body>
|
234 |
+
</html>
|
solar-farmville-master/js/main.js
ADDED
@@ -0,0 +1,356 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
var money = 1000;
|
2 |
+
var waste = 0;
|
3 |
+
var selected = 0;
|
4 |
+
var rateMoney = 0;
|
5 |
+
var rateWaste = 0;
|
6 |
+
var year = 2014;
|
7 |
+
var blocks = [{"bType":"", "bVersion":""},
|
8 |
+
{"bType":"", "bVersion":""},
|
9 |
+
{"bType":"", "bVersion":""},
|
10 |
+
{"bType":"", "bVersion":""},
|
11 |
+
{"bType":"", "bVersion":""},
|
12 |
+
{"bType":"", "bVersion":""}];
|
13 |
+
var firstBlock = false;
|
14 |
+
var smudFacts = ["SMUD's headquarters building, built in the late 1950s on the edge of the East Sacramento neighborhood, is notable for its mural by Wayne Thiebaud.",
|
15 |
+
"SMUD is one of the ten largest publicly owned utilities in the United States, generating the bulk of its power through natural gas.",
|
16 |
+
"SMUD houses large hydroelectric generation plants that account for 22% of its power.",
|
17 |
+
"SMUD's green power (renewable) energy output was estimated as 19% in 2009."];
|
18 |
+
|
19 |
+
$(document).ready(function(){
|
20 |
+
refreshMoney();
|
21 |
+
$('.titlescreen').fadeIn();
|
22 |
+
$('.year-number').text(year);
|
23 |
+
$('.block').click(function(){
|
24 |
+
if (blocks[$(this).data('block')].bType == "") {
|
25 |
+
$('.buy-menu').fadeIn();
|
26 |
+
} else {
|
27 |
+
upgradeImgRefresh();
|
28 |
+
$('.upgrade-menu').slideDown();
|
29 |
+
}
|
30 |
+
selected = $(this).data('block');
|
31 |
+
});
|
32 |
+
$('.escape-container').click(function(){
|
33 |
+
$('.popup').fadeOut();
|
34 |
+
});
|
35 |
+
$('.btn-next').click(function()
|
36 |
+
{
|
37 |
+
$('.year-report').fadeOut();
|
38 |
+
});
|
39 |
+
$('.btn-start').click(function(){
|
40 |
+
$('.popup').fadeOut();
|
41 |
+
});
|
42 |
+
$('.btn-buy').click(function(){
|
43 |
+
addBuilding(selected, $(this).data('buy'), 1);
|
44 |
+
refreshMoney();
|
45 |
+
$('.popup').fadeOut();
|
46 |
+
});
|
47 |
+
$('.btn-upgrade').click(function(){
|
48 |
+
upgrade(selected, blocks[selected].bType, $(this).data('upgrade'));
|
49 |
+
refreshMoney();
|
50 |
+
refreshVersion(selected);
|
51 |
+
$('.popup').fadeOut();
|
52 |
+
});
|
53 |
+
$('.btn-remove').click(function () {
|
54 |
+
var remove = blocks[selected];
|
55 |
+
remove.bType = "";
|
56 |
+
remove.bVersion = "";
|
57 |
+
refresh(selected);
|
58 |
+
$('.block[data-block=' + selected + '] .version-text').fadeOut();
|
59 |
+
$('.popup').fadeOut();
|
60 |
+
});
|
61 |
+
$('.btn-next-year').click(function(){
|
62 |
+
if (firstBlock) {
|
63 |
+
nextYear();
|
64 |
+
} else {
|
65 |
+
alert("You need to purchase your first energy source.");
|
66 |
+
}
|
67 |
+
});
|
68 |
+
$('.remove-waste-25-btn').click(function(){
|
69 |
+
if(money >= 200)
|
70 |
+
{
|
71 |
+
money = money - 200;
|
72 |
+
if(waste - 25 <= 0)
|
73 |
+
{
|
74 |
+
waste = 0;
|
75 |
+
}
|
76 |
+
else{
|
77 |
+
waste = waste - 25;
|
78 |
+
}
|
79 |
+
refreshMoney();
|
80 |
+
refreshWaste();
|
81 |
+
}
|
82 |
+
else{
|
83 |
+
alert('You do not have enough money');
|
84 |
+
}
|
85 |
+
refreshMoney();
|
86 |
+
refreshWaste();
|
87 |
+
});
|
88 |
+
$('.remove-waste-50-btn').click(function(){
|
89 |
+
if(money >= 400)
|
90 |
+
{
|
91 |
+
money = money - 400;
|
92 |
+
if(waste - 50 <= 0)
|
93 |
+
{
|
94 |
+
waste = 0;
|
95 |
+
}
|
96 |
+
else{
|
97 |
+
waste = waste - 50;
|
98 |
+
}
|
99 |
+
refreshMoney();
|
100 |
+
refreshWaste();
|
101 |
+
}
|
102 |
+
else{
|
103 |
+
alert('You do not have enough money');
|
104 |
+
}
|
105 |
+
refreshMoney();
|
106 |
+
refreshWaste();
|
107 |
+
});
|
108 |
+
});
|
109 |
+
|
110 |
+
function addBuilding (blockId, buildingType, buildingVersion){
|
111 |
+
switch(buildingType){
|
112 |
+
case 'oil':
|
113 |
+
if (firstBlock == false) {
|
114 |
+
firstBlock = true;
|
115 |
+
}
|
116 |
+
if (money >= 100) {
|
117 |
+
blocks[blockId].bType = "oil";
|
118 |
+
blocks[blockId].bVersion = buildingVersion;
|
119 |
+
money = money - 100;
|
120 |
+
rateMoney = rateMoney + 100;
|
121 |
+
rateWaste = rateWaste + 15;
|
122 |
+
refresh(selected);
|
123 |
+
} else {
|
124 |
+
alert("Need mas money!");
|
125 |
+
}
|
126 |
+
break;
|
127 |
+
case 'solar':
|
128 |
+
if (money >= 500) {
|
129 |
+
blocks[blockId].bType = "solar";
|
130 |
+
blocks[blockId].bVersion = buildingVersion;
|
131 |
+
money = money - 500;
|
132 |
+
rateMoney = rateMoney + 250;
|
133 |
+
rateWaste = rateWaste + 5;
|
134 |
+
refresh(selected);
|
135 |
+
} else {
|
136 |
+
alert("Need mas money!");
|
137 |
+
}
|
138 |
+
break;
|
139 |
+
case 'nuclear':
|
140 |
+
if (money >= 2500) {
|
141 |
+
blocks[blockId].bType = "nuclear";
|
142 |
+
blocks[blockId].bVersion = buildingVersion;
|
143 |
+
money = money - 2500;
|
144 |
+
rateMoney = rateMoney + 1500;
|
145 |
+
rateWaste = rateWaste + 15;
|
146 |
+
refresh(selected);
|
147 |
+
} else {
|
148 |
+
alert("Need mas money!");
|
149 |
+
}
|
150 |
+
break;
|
151 |
+
case 'wind':
|
152 |
+
if (money >= 1500) {
|
153 |
+
blocks[blockId].bType = "wind";
|
154 |
+
blocks[blockId].bVersion = buildingVersion;
|
155 |
+
money = money - 1500;
|
156 |
+
rateMoney = rateMoney + 500;
|
157 |
+
rateWaste = rateWaste + 5;
|
158 |
+
refresh(selected);
|
159 |
+
} else {
|
160 |
+
alert("Need mas money!");
|
161 |
+
}
|
162 |
+
break;
|
163 |
+
default:
|
164 |
+
blocks[blockId].bType = null;
|
165 |
+
blocks[blockId].bVersion = null;
|
166 |
+
break;
|
167 |
+
}
|
168 |
+
}
|
169 |
+
|
170 |
+
function upgrade(blockId, buildingType, buildingVersion) {
|
171 |
+
switch(buildingVersion){
|
172 |
+
case 1:
|
173 |
+
if (blocks[blockId].bVersion == 1) {
|
174 |
+
alert('This is already your version.');
|
175 |
+
} else {
|
176 |
+
|
177 |
+
}
|
178 |
+
break;
|
179 |
+
case 2:
|
180 |
+
if (blocks[blockId].bVersion == 2) {
|
181 |
+
alert('This is already your version.');
|
182 |
+
} else {
|
183 |
+
if (money >= 1000){
|
184 |
+
blocks[blockId].bVersion = buildingVersion;
|
185 |
+
money = money - 1000;
|
186 |
+
rateMoney = rateMoney + 100 * 1.5;
|
187 |
+
rateWaste = rateWaste + 5;
|
188 |
+
} else {
|
189 |
+
alert("Need mas money!");
|
190 |
+
}
|
191 |
+
}
|
192 |
+
break;
|
193 |
+
case 3:
|
194 |
+
if (blocks[blockId].bVersion == 3000) {
|
195 |
+
alert('This is already your version.');
|
196 |
+
} else {
|
197 |
+
if (money >= 3000){
|
198 |
+
blocks[blockId].bVersion = buildingVersion;
|
199 |
+
money = money - 3000;
|
200 |
+
rateMoney = rateMoney + 100 * 2;
|
201 |
+
rateWaste = rateWaste + 5;
|
202 |
+
} else {
|
203 |
+
alert("Need mas money!");
|
204 |
+
}
|
205 |
+
}
|
206 |
+
break;
|
207 |
+
case '':
|
208 |
+
|
209 |
+
break;
|
210 |
+
default:
|
211 |
+
break;
|
212 |
+
}
|
213 |
+
}
|
214 |
+
|
215 |
+
function upgradeImgRefresh() {
|
216 |
+
var type = blocks[selected].bType;
|
217 |
+
var imgUrl;
|
218 |
+
switch(type){
|
219 |
+
case 'oil':
|
220 |
+
imgUrl = "img/oil.png";
|
221 |
+
break;
|
222 |
+
case 'solar':
|
223 |
+
imgUrl = "img/solar.png";
|
224 |
+
break;
|
225 |
+
case 'nuclear':
|
226 |
+
imgUrl = "img/nuclear.png";
|
227 |
+
break;
|
228 |
+
case 'wind':
|
229 |
+
imgUrl = "img/wind.png";
|
230 |
+
break;
|
231 |
+
case '':
|
232 |
+
imgUrl = null;
|
233 |
+
break;
|
234 |
+
default:
|
235 |
+
imgUrl = null;
|
236 |
+
break;
|
237 |
+
}
|
238 |
+
$('.upgrade-menu img').attr('src', imgUrl);
|
239 |
+
}
|
240 |
+
|
241 |
+
function refresh (blockId){
|
242 |
+
var type = blocks[blockId].bType;
|
243 |
+
var version = blocks[blockId].bVersion;
|
244 |
+
var imgUrl;
|
245 |
+
switch(type){
|
246 |
+
case 'oil':
|
247 |
+
imgUrl = "img/oil.png";
|
248 |
+
break;
|
249 |
+
case 'solar':
|
250 |
+
imgUrl = "img/solar.png";
|
251 |
+
break;
|
252 |
+
case 'nuclear':
|
253 |
+
imgUrl = "img/nuclear.png";
|
254 |
+
break;
|
255 |
+
case 'wind':
|
256 |
+
imgUrl = "img/wind.png";
|
257 |
+
break;
|
258 |
+
case '':
|
259 |
+
imgUrl = null;
|
260 |
+
break;
|
261 |
+
default:
|
262 |
+
imgUrl = null;
|
263 |
+
break;
|
264 |
+
}
|
265 |
+
$('.block[data-block=' + blockId + '] img').attr('src', imgUrl);
|
266 |
+
$('.block[data-block=' + blockId + '] .version-text').text('Version ' + version);
|
267 |
+
$('.block[data-block=' + blockId + '] .version-text').data('version', version);
|
268 |
+
$('.block[data-block=' + blockId + '] .version-text').fadeIn();
|
269 |
+
}
|
270 |
+
|
271 |
+
function refreshVersion(blockId){
|
272 |
+
var type = blocks[blockId].bType;
|
273 |
+
var version = blocks[blockId].bVersion;
|
274 |
+
$('.block[data-block=' + blockId + '] .version-text').text('Version ' + version);
|
275 |
+
$('.block[data-block=' + blockId + '] .version-text').data('version', version);
|
276 |
+
}
|
277 |
+
|
278 |
+
function refreshMoney (){
|
279 |
+
$('.money-amount').text('$' + money);
|
280 |
+
}
|
281 |
+
|
282 |
+
function refreshWaste (){
|
283 |
+
var wasteBar = $('.waste-bar');
|
284 |
+
wasteBar.text(waste + '%');
|
285 |
+
wasteBar.css('width', waste + '%');
|
286 |
+
}
|
287 |
+
|
288 |
+
function nextYear(){
|
289 |
+
$('.year-report').fadeIn();
|
290 |
+
$('.year-gain').text(rateMoney);
|
291 |
+
$('.year-waste').text(rateWaste + '%');
|
292 |
+
money = money + rateMoney;
|
293 |
+
waste = waste + rateWaste;
|
294 |
+
$('.fact-text').text(smudFacts[Math.floor(Math.random()*smudFacts.length)]);
|
295 |
+
$('.remove-waste-25').text('$200');
|
296 |
+
$('.remove-waste-50').text('$400');
|
297 |
+
if (waste >= "100"){
|
298 |
+
gameOver();
|
299 |
+
var wasteBar = $('.waste-bar');
|
300 |
+
wasteBar.text('100%');
|
301 |
+
wasteBar.css('width', '100%');
|
302 |
+
} else {
|
303 |
+
refreshMoney();
|
304 |
+
refreshWaste();
|
305 |
+
year++;
|
306 |
+
$('.year-number').text(year);
|
307 |
+
}
|
308 |
+
}
|
309 |
+
|
310 |
+
function wipeGrid(){
|
311 |
+
for (var i = blocks.length - 1; i >= 0; i--) {
|
312 |
+
refresh(i);
|
313 |
+
};
|
314 |
+
}
|
315 |
+
|
316 |
+
function gameOver(){
|
317 |
+
$('.yearnum').text(year - 2014);
|
318 |
+
$('.btn-next-year').fadeOut('fast');
|
319 |
+
$('.gameover').fadeIn();
|
320 |
+
$('.btn-again').click(function(){
|
321 |
+
money = 1000;
|
322 |
+
refreshMoney();
|
323 |
+
waste = 0;
|
324 |
+
refreshWaste();
|
325 |
+
selected = 0;
|
326 |
+
rateMoney = 0;
|
327 |
+
rateWaste = 0;
|
328 |
+
year = 2014;
|
329 |
+
$('.year-number').text(year);
|
330 |
+
blocks = [{"bType":"", "bVersion":""},
|
331 |
+
{"bType":"", "bVersion":""},
|
332 |
+
{"bType":"", "bVersion":""},
|
333 |
+
{"bType":"", "bVersion":""},
|
334 |
+
{"bType":"", "bVersion":""},
|
335 |
+
{"bType":"", "bVersion":""}];
|
336 |
+
wipeGrid();
|
337 |
+
$('.gameover').fadeOut();
|
338 |
+
$('.version-text').fadeOut();
|
339 |
+
$('.btn-next-year').fadeIn();
|
340 |
+
year = 0;
|
341 |
+
firstBlock = false;
|
342 |
+
});
|
343 |
+
$('.btn-menu').click(function(){
|
344 |
+
|
345 |
+
});
|
346 |
+
|
347 |
+
}
|
348 |
+
|
349 |
+
//Add next year if buildings exist done
|
350 |
+
//add title screen done
|
351 |
+
//fix image sizes done
|
352 |
+
//change year to year done
|
353 |
+
|
354 |
+
//add versions
|
355 |
+
//show benefits
|
356 |
+
//upgrade all same + percentage differences
|
solar-farmville-master/links
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
http://previewcf.turbosquid.com/Preview/2014/08/01__17_56_46/grass_tex.jpgb91b8892-a3aa-4b03-bde2-0be3478eae61Larger.jpg
|