-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
287 lines (276 loc) · 10.8 KB
/
index.html
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
<head>
<style type="text/css">
body {
display: table;
margin: 0 auto;
background: black;
font-family: Arial;
font-weight: 600;
}
label {
color: white;
font-weight: 600;
}
#customization {
display: none;
background-image: url('assets/images/space_bg.png');
width: 1280px;
height: 600px;
color: white;
}
fieldset {
text-align: center;
width: 500px;
margin: 10px auto;
}
.highlightedHighScoreRow {
color: greenyellow;
}
#highScores {
position: absolute;
top: 0;
left: 0;
color: white;
width: 200px;
background-color: black;
}
#highScoresTable {
position: absolute;
top: 20;
left: 0;
color: white;
text-align: center;
background-color: gray;
border: 1px solid white;
border-radius: 5px;
}
.increaseStatButton {
margin: 5px;
}
.increaseStatCost {
font-size: 12px;
font-weight: 400px;
display: inline-block;
padding-right: 30px;
}
.increaseStatValueLabel {
color: #fffbbc;
}
#nameInputDiv {
color: white;
display: none;
position: absolute;
top: 370;
left: 50%;
transform: translate(-50%, -50%);
}
</style>
<script src="src/main.js" type="module"></script>
</head>
<body>
<div id="introScreen" style="display:none">
<label>
<input id="nameLabel" type="text" value="Player 1" />
</label>
</div>
<div style="text-align: center;">
<label>
Score:
<label id="scoreLabel">0</label>
</label>
<label style="padding-left: 20px">
Credits:
<label id="creditsLabel">0</label>
</label>
<label style="padding-left: 20px">
Time Alive (seconds):
<label id="timeAliveInSeconds">0</label>
</label>
<label style="padding-left: 20px">
Longest Time Alive (seconds):
<label id="longestTimeAliveInSeconds">0</label>
</label>
<button id="muteButton" style="display: inline-block; margin-left: 20px;">Mute</button>
</div>
<canvas id="canvas"></canvas>
<div id="customization">
<div style="text-align: center; font-size: 36px; padding-top: 25px; padding-bottom: 25px;">Customize your Ship</div>
<div style="text-align: center; margin: 20px;">
<label>You have </label>
<label id="numberOfCredits" style="color: #fffbbc;"></label>
<label> Credits to spend</label>
</div>
<fieldset>
<legend>Extra Cannons</legend>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="extraCannonCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
<div>
<input type="checkbox" id="extra-cannon-top" name="extra-cannon" />
<label for="extra-cannon-top">Top Cannon</label>
<input type="checkbox" id="extra-cannon-bottom" name="extra-cannon" />
<label for="extra-cannon-bottom">Bottom Cannon</label>
</div>
</fieldset>
<fieldset>
<legend>Shot Type</legend>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="shotTypeCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
<div>
<input type="radio" id="shot-type-standard" name="shot-type" checked/>
<label for="shot-type-standard">Standard</label>
<input type="radio" id="shot-type-overlap" name="shot-type" />
<label for="shot-type-overlap">Overlap</label>
<input type="radio" id="shot-type-spread" name="shot-type" />
<label for="shot-type-spread">Spread</label>
<input type="radio" id="shot-type-ball" name="shot-type" />
<label for="shot-type-ball">Ball</label>
<input type="radio" id="shot-type-burst" name="shot-type" />
<label for="shot-type-burst">Burst</label>
<input type="radio" id="shot-type-side" name="shot-type" />
<label for="shot-type-side">Side</label>
</div>
</fieldset>
<fieldset>
<legend>Shot Modifiers</legend>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="shotModifierCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
<div>
<input type="checkbox" id="shot-modifier-pierce-once" name="shot-modifier" />
<label for="shot-modifier-pierce-once">Pierce once</label>
<input type="checkbox" id="shot-modifier-fork-once" name="shot-modifier" />
<label for="shot-modifier-fork-once">Fork once</label>
</div>
</fieldset>
<table id="shipCustomizeStats" style="margin: 10px auto; text-align: right;">
<tr>
<td>
<label>Number of Projectiles: </label>
<label id="numberOfProjectiles" class="increaseStatValueLabel"></label>
<button id="increaseNumberOfProjectilesButton" class="increaseStatButton">Increase</button>
<button id="increaseNumberOfProjectilesSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="numberOfProjectilesCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
<td>
<label>Projectile Range: </label>
<label id="projectileRange" class="increaseStatValueLabel"></label>
<button id="increaseProjectileRangeButton" class="increaseStatButton">Increase</button>
<button id="increaseProjectileRangeSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="projectileRangeCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
</tr>
<tr>
<td>
<label>Projectile Size: </label>
<label id="projectileSize" class="increaseStatValueLabel"></label>
<button id="increaseProjectileSizeButton" class="increaseStatButton">Increase</button>
<button id="increaseProjectileSizeSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="projectileSizeCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
<td>
<label>Projectile Speed: </label>
<label id="projectileSpeed" class="increaseStatValueLabel"></label>
<button id="increaseProjectileSpeedButton" class="increaseStatButton">Increase</button>
<button id="increaseProjectileSpeedSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="projectileSpeedCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
</tr>
<tr>
<td>
<label>Ship Size: </label>
<label id="size" class="increaseStatValueLabel"></label>
<button id="decreaseSizeButton" class="increaseStatButton">Decrease</button>
<button id="decreaseSizeSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="sizeCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
<td>
<label>Ship Speed: </label>
<label id="speed" class="increaseStatValueLabel"></label>
<button id="increaseSpeedButton" class="increaseStatButton">Increase</button>
<button id="increaseSpeedSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="speedCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
</tr>
<tr>
<td>
<label>Ship Top Speed: </label>
<label id="topSpeed" class="increaseStatValueLabel"></label>
<button id="increaseTopSpeedButton" class="increaseStatButton">Increase</button>
<button id="increaseTopSpeedSpendAllButton" class="increaseStatButton">Spend All</button>
<div class="increaseStatCost">
<label>Cost: </label>
<label id="topSpeedCost" class="increaseStatValueLabel"></label>
<label> Credits</label>
</div>
</td>
</tr>
</table>
<div style="text-align: center; font-size: 36px; margin-top: 10px; color: #fffbbc;">Press 'r' to Start Game</div>
</div>
<div id="nameInputDiv">
Name:
<input id="nameInput" type="text" value="Player"></input>
</div>
<div id="highScores" style="display: none">
High Scores
<table id="highScoresTable"></table>
</div>
<div id="assets" style="display: none">
<img id="asteroidImage" src="assets/images/asteroid.png" />
<img id="enemyProjectileImage" src="assets/images/projectile_red.png" />
<img id="enemyShipImage" src="assets/images/enemy_ship.png" />
<img id="enemyShipDamagedImage" src="assets/images/enemy_ship_damaged.png" />
<img id="explosion1Image" src="assets/images/explosion1.png" />
<img id="explosion2Image" src="assets/images/explosion2.png" />
<img id="explosion3Image" src="assets/images/explosion3.png" />
<img id="explosion4Image" src="assets/images/explosion4.png" />
<img id="heartyImage" src="assets/images/hearty.png" />
<img id="heartyDamagedImage" src="assets/images/hearty_damaged.png" />
<img id="projectileImage" src="assets/images/projectile.png" />
<img id="ship1Image" src="assets/images/ship1.png" />
<img id="ship2Image" src="assets/images/ship2.png" />
<img id="spaceInvaderImage" src="assets/images/space_invader.png" />
<img id="spaceInvaderDamagedImage" src="assets/images/space_invader_damaged.png" />
<img id="speedsterImage" src="assets/images/speedster.png" />
<img id="speedsterDamagedImage" src="assets/images/speedster_damaged.png" />
<img id="backgroundImage" src="assets/images/space_bg.png" />
<audio id="music-background" src="assets/sounds/Death_Sword_v1.0.mp3" type="audio/mpeg" autostart="0" loop="true"></audio>
<audio id="sound-big-explosion" src="assets/sounds/bigExplosion.wav" type="audio/wav" autostart="0"></audio>
<audio id="sound-explosion" src="assets/sounds/explosion.wav" type="audio/wav" autostart="0"></audio>
<audio id="sound-hit" src="assets/sounds/hit.wav" type="audio/wav" autostart="0"></audio>
<audio id="sound-shoot" src="assets/sounds/shoot.wav" type="audio/wav" autostart="0"></audio>
<audio id="sound-upgrade" src="assets/sounds/upgrade.wav" type="audio/wav" autostart="0"></audio>
</div>
</body>