-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathindex.html
279 lines (245 loc) · 8.45 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
<!DOCTYPE html>
<html>
<head>
<title>Spaced</title>
<script type="module" src="/scripts/index.js"></script>
<link rel="stylesheet" href="/styles/index.css" />
<link rel="stylesheet" href="/styles/colors.css" />
<link rel="stylesheet" href="/styles/type.css" />
<link rel="stylesheet" href="/styles/game-core.css" />
<link rel="stylesheet" href="/styles/animations.css" />
<link rel="stylesheet" href="/styles/hud.css" />
<link rel="stylesheet" href="/styles/messages.css" />
<link rel="stylesheet" href="/styles/menus.css" />
<link rel="stylesheet" href="/styles/button.css" />
<meta name="viewport" content="width=device-width" />
</head>
<body>
<div class="game">
<h2 class="sector-title"></h2>
<canvas id="main-canvas" width="500" height="500"></canvas>
<div class="hud">
<div class="hud-section">
<div>
Weapons:
<ul class="weapons-list"></ul>
</div>
<div>
Credits:
<span class="resource-count">0</span>
</div>
<div class="shields-ui" hidden>
Shields:
<meter
class="shields"
value="100"
min="0"
max="100"
low="30"
high="80"
optimum="100"
></meter>
</div>
<div>
Health:
<meter
class="health"
value="100"
min="0"
max="100"
low="30"
high="80"
optimum="100"
></meter>
</div>
</div>
<canvas
id="mini-map-canvas"
class="hud-section"
width="200"
height="200"
></canvas>
</div>
<div class="message-queue"></div>
</div>
<div class="menus">
<div class="restart-menu menu danger themed">
<div class="menu-inner">
<div class="menu-section">
<h2>Your Ship Has Been Destroyed</h2>
</div>
<div class="menu-section subhead">
<p class="sectors-cleared"></p>
<p class="ships-destroyed"></p>
</div>
<div class="menu-section">
<button class="restart-button">Try again?</button>
</div>
</div>
</div>
<div class="pause-menu menu">
<div class="menu-inner">
<div class="menu-section">
<h2>The Game Has Been Paused</h2>
</div>
<div class="menu-section">
<button class="resume-button">Resume Playing</button>
<button class="restart-button">Start Over</button>
</div>
</div>
</div>
<div class="shield-upgrade-menu menu success themed">
<div class="menu-inner">
<div class="menu-section">
<h2>You Picked up a Shield!</h2>
</div>
<div class="menu-section subhead">
<p>
If you take damage while your shields are charged, it will damage
your shields instead of your ship health.
</p>
<p>Shields slowly recharge over time.</p>
</div>
<div class="menu-section">
<button class="resume-button">Got it!</button>
</div>
</div>
</div>
<div class="success-menu menu">
<div class="menu-inner">
<div class="menu-section">
<h2>You win!</h2>
</div>
<div class="menu-section subhead">
<p class="sectors-cleared"></p>
<p class="ships-destroyed"></p>
</div>
<div class="menu-section">
<button class="restart-button">Restart</button>
</div>
</div>
</div>
<div class="start-menu menu is-shown">
<div class="menu-inner">
<div class="menu-section">
<h1>Spaced</h1>
</div>
<div class="menu-section subhead">
<p>
You've escaped from a penal mining colony flying a stolen mining
rig.
</p>
<p>
Can you stay alive and fight your way back to your home world?
</p>
</div>
<div class="menu-section">
<button class="settings-button">Get Started</button>
</div>
</div>
</div>
<div class="settings-menu menu">
<div class="menu-inner">
<div class="menu-section">
<h2>Pick Your Game Settings</h2>
</div>
<div class="menu-section">
<form class="settings menu-section">
<fieldset class="controls-fieldset">
<legend>Controls:</legend>
<label class="radio-chunk">
<input name="controls" value="pointer" type="radio" checked />
<span class="radio-details">
<b class="radio-title">Mouse-Based Navigation</b>
<ul>
<li>Move your mouse to rotate your ship.</li>
<li>Press <kbd>a</kbd> to accelerate.</li>
<li>Press <kbd>s</kbd> to shoot.</li>
<li>Press <kbd>d</kbd> to change weapons.</li>
</ul>
</span>
</label>
<label class="radio-chunk">
<input name="controls" value="keyboard" type="radio" />
<span class="radio-details">
<b class="radio-title">Arrow Key Navigation</b>
<ul>
<li>Use the arrow keys to fly your ship.</li>
<li>Press <kbd>Spacebar</kbd> to shoot.</li>
<li>Press <kbd>Shift</kbd> to change weapons.</li>
</ul>
</span>
</label>
<p class="disclaimer">
Sorry, touch screen controls are not yet supported.
</p>
</fieldset>
<fieldset>
<legend>Settings:</legend>
<label>
<input type="checkbox" name="full-screen" checked />
Enable Full Screen
</label>
<label>
<input type="checkbox" name="enable-sound" checked />
Enable Sound
</label>
<label>
<input type="checkbox" name="enable-music" checked />
Enable Music
</label>
</fieldset>
</form>
</div>
<div class="menu-section">
<button class="start-button">Blast Off!</button>
</div>
</div>
</div>
</div>
<!-- https://codepen.io/phebert/pen/QWrzMBM?editors=1010 -->
<img id="asteroid-sprites" src="/graphics/asteroids.png" hidden />
<img id="bomb" src="/graphics/bomb.svg" alt="" hidden />
<img id="ship" src="/graphics/ship.svg" alt="" hidden />
<img id="ship-2" src="/graphics/ship-2.svg" alt="" hidden />
<img id="ship-3" src="/graphics/ship-3.svg" alt="" hidden />
<img id="ship-4" src="/graphics/ship-4.svg" alt="" hidden />
<img id="ship-5" src="/graphics/ship-5.svg" alt="" hidden />
<img id="sparrow" src="/graphics/sparrow.svg" alt="" hidden />
<img id="space-station" src="/graphics/space-station.svg" alt="" hidden />
<img id="cursor" src="/graphics/cursor.svg" alt="" hidden />
<img
id="minimap-ship-player"
src="/graphics/minimap-ship-player.svg"
alt=""
hidden
/>
<img
id="minimap-ship-enemy"
src="/graphics/minimap-ship-enemy.svg"
alt=""
hidden
/>
<img id="gun" src="/graphics/gun.svg" alt="" hidden />
<img id="laser" src="/graphics/laser.svg" alt="" hidden />
<img id="pew" src="/graphics/pew.svg" alt="" hidden />
<div class="small-screen-warning menu is-shown">
<div class="menu-inner">
<div class="menu-section">
<h2>Your Screen or Window is too small</h2>
</div>
<div class="menu-section">
<p>
I'm sorry. Your device screen or browser window is too small to play
Spaced.
</p>
<p>Please try playing with a larger device with a keyboard.</p>
<p>
This game is a work in progress, and I hope to support smaller
screens and touch screens soon.
</p>
</div>
</div>
</div>
</body>
</html>