-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathshift.htm
330 lines (297 loc) · 14 KB
/
shift.htm
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
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
<!DOCTYPE html>
<html>
<head>
<title>Shift: Simple, Colorful, Fun</title>
<link rel="stylesheet" type="text/css" href="css/shift.css" />
<script type="text/javascript" src="js/Util.js"></script>
<script type="text/javascript" src="js/GameEngine.js"></script>
<script type="text/javascript" src="js/WaveGenerator.js"></script>
<script type="text/javascript" src="js/AdGenerator.js"></script>
<script type="text/javascript" src="js/SoundManager.js"></script>
<script type="text/javascript" src="js/MinimalismQuotes.js"></script>
<script type="text/javascript" src="js/Level.js"></script>
<script type="text/javascript" src="js/SubWave.js"></script>
<!-- UI Wrapper Components -->
<script type="text/javascript" src="js/ui/HealthBlock.js"></script>
<script type="text/javascript" src="js/ui/UIElement.js"></script>
<script type="text/javascript" src="js/ui/WaveProgressUI.js"></script>
<script type="text/javascript" src="js/ui/Shape.js"></script>
<script type="text/javascript" src="js/ui/SliderUI.js"></script>
<script type="text/javascript" src="js/ui/GameBoard.js"></script>
<script type="text/javascript" src="js/ui/Blocker.js"></script>
<!-- UI for popup screens and game pausing -->
<script type="text/javascript" src="js/PopupManager.js"></script>
<!-- Touch handling components -->
<script type="text/javascript" src="js/TouchPoint.js"></script>
<script type="text/javascript" src="js/TouchPointManager.js"></script>
<script>
//Global Variable
var _adGenerator = null;
var gameEngine;
var sliderUI;
var levelData = [
/* Test level data */
/*
new Level(100, 600, 2, 3, 7, 1, 0.2,
[new SubWave(100, 100, 0.8)],
"Test don't ship.",
"Test don't ship."),
*/
/* Real level data */
new Level(300, 3600, 2, 3, 7, 1, 0.2,
[new SubWave(1800, 600, 0.8)],
"Why do my attempts to move the pieces always end up the same way.",
"In life one can only move forward."),
new Level(300, 3600, 2, 3, 7, 1, 0.2,
[new SubWave(1200, 600, 0.8), new SubWave(2400, 600, 0.8)],
"Sometimes I have a problem for which I don't have a solution.",
"If you look hard enough you can see your future path."),
new Level(280, 4800, 2, 3, 7, 1.1, 0.2,
[new SubWave(1800, 1000, 0.8), new SubWave(3200, 1000, 0.8)],
"I feel that life moves faster than I am able to respond.",
"The KEY is to learn to move faster."),
new Level(280, 4800, 2, 3, 7, 1.2, 0.2,
[new SubWave(1800, 1000, 0.8), new SubWave(3200, 1000, 0.8)],
"When things are rushed I feel overwhelmed.",
"Every great moment is marked by a great man."),
new Level(250, 5600, 2, 3, 7, 1.2, 0.2,
[new SubWave(1800, 1000, 0.7), new SubWave(3200, 1000, 0.7)],
"I find myself getting bored with these simple problems now.",
"Life always grows to challenge the enlightened."),
new Level(280, 3600, 3, 3, 7, 1, 0.2,
[new SubWave(1800, 600, 0.8)],
"I suddenly find my problems changing shape.",
"As your problems change shape, so shall your solutions."),
new Level(280, 3600, 3, 3, 7, 1.1, 0.2,
[new SubWave(1800, 600, 0.8)],
"When does one find time to find relief from life's problems?",
"To pause is to reflect."),
new Level(250, 3600, 3, 4, 7, 1.2, 0.2,
[new SubWave(1800, 600, 0.8)],
"After staring at my problems lately, I've noticed a pattern.",
"Stare harder and new patterns shall emerge."),
new Level(230, 3600, 3, 4, 7, 1.2, 0.2,
[new SubWave(1800, 600, 0.8)],
"Why is life so challenging? Is there a god?",
"Have you tried clicking on an ad lately?"),
new Level(230, 3600, 3, 4, 7, 1.2, 0.2,
[new SubWave(1800, 600, 0.8)]),
];
function Init() {
_adGenerator = new AdGenerator();
gameEngine = new GameEngine(levelData,
document.getElementById("blackSquare"),
document.getElementById("waveProgressUI"),
document.getElementById("sliderUI"),
document.getElementById("panelGameBoard"),
document.getElementById("panelPieceHints"),
document.getElementById("panelBlockers"));
window.blackSquare = new HealthBlock("blackSquare");
// Set up the sound manager
PopupManager.initPopups(document.getElementById("popupManager"), "popup");
SoundManager.setupAudio("soundManager", "audioSingles", "audioInstances");
// Start the animation loop
requestAnimationFrame(GameLoop);
// But immediately pause the game for the intro screen
PopupManager.showPopup("popupIntro", StartGame);
}
function StartGame() {
// Start first level
gameEngine.advanceLevel();
}
function GameLoop() {
if (!PopupManager.paused) {
gameEngine.processTick();
_adGenerator.processTick();
}
requestAnimationFrame(GameLoop);
}
</script>
</head>
<body onload="Init();">
<div id="screenBoard" class="screen">
<div id="panelTop" class="panel">
<div id="panelAd" class="subPanel">
</div>
<div id="panelPieceHints" class="subPanel">
</div>
<div id="panelWaveProgress" class="subPanel">
<div id="waveProgressUI">
<div id="progressBar">
<div id="progressIndicator">
</div>
</div>
</div>
</div>
</div>
<div id="panelMid" class="panel">
<div id="panelGameBoard" class="subPanel">
<div id="panelBlackSquare" class="subPanel">
<div id="blackSquare"></div>
</div>
<div id="panelBlockers" class="subPanel"></div>
</div>
</div>
<div id="panelBottom" class="panel">
<div id="panelSocial" class="subPanel">
<table>
<tr>
<td><a href="https://twitter.com/share" class="twitter-share-button" data-url="http://iegamejams.github.io/shiftgame" data-text="I just played The Kazimir Shift." data-via="JustRogDigiTec" data-hashtags="TheKazimirShift" data-dnt="true">Tweet</a></td>
<td><a target="_blank" href="http://www.ludumdare.com/compo/ludum-dare-26/?action=preview&uid=14372">Vote in LD 26!</a></td>
<td><a target="_blank" href="https://github.com/iegamejams/shiftgame">View Source</a></td>
</tr>
</table>
</div>
<div id="panelSliders" class="subPanel">
<div id="sliderUI">
<div class="sliderButtons" data-column="0" data-key="a">a</div>
<div class="sliderButtons" data-column="1" data-key="s">s</div>
<div class="sliderButtons" data-column="2" data-key="d">d</div>
<div class="sliderButtons" data-column="3" data-key="f">f</div>
<div class="sliderButtons" data-column="4" data-key="j">j</div>
<div class="sliderButtons" data-column="5" data-key="k">k</div>
<div class="sliderButtons" data-column="6" data-key="l">l</div>
<div class="sliderButtons" data-column="7" data-key=";">;</div>
</div>
</div>
<div id="panelButtons" class="subPanel">
<div id="pauseButton" onclick="if (gameEngine) { gameEngine.pauseGame(); }">| |</div>
</div>
</div>
<div id="templates">
<svg class="shape square" xmlns="http://www.w3.org/2000/svg">
<rect x="2" y="2" width="44" height="44" class="path"></rect>
</svg>
<svg class="shape circle" xmlns="http://www.w3.org/2000/svg">
<circle cx="24" cy="24" r="22" class="path"></circle>
</svg>
<svg class="shape triangle" xmlns="http://www.w3.org/2000/svg">
<polygon points="2,46 24,2 46,46" class="path"></polygon>
</svg>
<svg class="shape cross" xmlns="http://www.w3.org/2000/svg">
<polygon points="2,35 13,24 2,13 13,2 24,13 35,2 46,13 35,24 46,35 35,46 24,35 13,46" class="path"></polygon>
</svg>
<svg class="shape diamond" xmlns="http://www.w3.org/2000/svg">
<polygon points="8,24 24,2 40,24 24,46" class="path"></polygon>
</svg>
<svg class="shape pentagon" xmlns="http://www.w3.org/2000/svg">
<polygon points="2,20 24,2 46,20 38,46 10,46" class="path"></polygon>
</svg>
<div class="rail">
<div class="slot"></div>
</div>
</div>
</div>
<!-- Game Popups -->
<div id="popupManager" class="visible">
<!-- Introduction screen popup. Shows an ominous black square on white background. -->
<div id="popupIntro" class="popup visible">
<div id="popupIntro_Malevich"></div>
</div>
<!-- Pause Popup -->
<div id="popupPause" class="popup">
<div id="popupPause_Frame" class="popupFrame">
<div id="popupPause_Saying">
A learned man takes each step forward in life without...<br><br>
pause...
</div>
</div>
</div>
<!-- Level Popup -->
<div id="popupLevel" class="popup">
<div id="popupLevel_Frame" class="popupFrame">
<div id="popupLevel_Title">Level <span id="popupLevel_Level"></span></div>
<div id="popupLevel_StudentTitle">Student:</div>
<div id="popupLevel_StudentSaying"></div>
<div id="popupLevel_MasterTitle">Master:</div>
<div id="popupLevel_MasterSaying"></div>
<div id="popupLevel_Enlightened">... and the student was enlightened.</div>
</div>
</div>
<!-- Credits Menu -->
<div id="popupCredits" class="popup">
<div id="popupCredits_Frame" class="popupFrame">
<div class="popupCredits_Title">One Should Not Required Credit</div>
<div class="popupCredits_Title">For That Which One Is Born To Do.</div>
<table id="popupCredits_Table">
<tr>
<td>Project Coordinator</td>
<td>DigiTec</td>
<td>Justin Rogers</td>
</tr>
<tr>
<td>Collision Manager</td>
<td></td>
<td>Christopher Kawasaki</td>
</tr>
<tr>
<td>Shape Advisor</td>
<td></td>
<td>Josh Lory</td>
</tr>
<tr>
<td>HR: Touch Advisor</td>
<td></td>
<td>Matt Rakow</td>
</tr>
<tr>
<td>Square Coder</td>
<td></td>
<td>Tyler Arehart</td>
</tr>
<tr>
<td>Brogrammer</td>
<td></td>
<td>Will Kennedy</td>
</tr>
<tr>
<td>{ Waves }</td>
<td></td>
<td>Sandy Roberts</td>
</tr>
<tr>
<td></td>
<td></td>
<td></td>
</tr>
<tr>
<td>Musician Magician</td>
<td>DST</td>
<td></td>
</tr>
</table>
</div>
</div>
</div>
<!-- Sound Resources -->
<div id="soundManager">
<div id="audioSingles">
<audio id="bg1" src="mp3/music/DST-2ndBallad.mp3" preload="none" loop="loop"></audio>
<audio id="bg2" src="mp3/music/DST-909Dreams.mp3" preload="none" loop="loop"></audio>
<audio id="bg3" src="mp3/music/DST-Aethereal.mp3" preload="none" loop="loop"></audio>
<audio id="bg4" src="mp3/music/DST-Away.mp3" preload="none" loop="loop"></audio>
<audio id="bg5" src="mp3/music/DST-BreakIt.mp3" preload="none" loop="loop"></audio>
<audio id="bg6" src="mp3/music/DST-Canopy.mp3" preload="none" loop="loop"></audio>
<audio id="bg7" src="mp3/music/DST-Horizon.mp3" preload="none" loop="loop"></audio>
<audio id="bg8" src="mp3/music/DST-JugleHaze.mp3" preload="none" loop="loop"></audio>
<audio id="bg9" src="mp3/music/DST-Raiser.mp3" preload="none" loop="loop"></audio>
</div>
<div id="audioInstances">
<audio id="boop1" src="mp3/boop1.mp3" preload="auto"></audio>
<audio id="boop2" src="mp3/boop2.mp3" preload="auto"></audio>
<audio id="boop3" src="mp3/boop3.mp3" preload="auto"></audio>
</div>
</div>
<!-- Twitter -->
<script>
!function (d, s, id) {
var js, fjs = d.getElementsByTagName(s)[0];
if (!d.getElementById(id)) {
js = d.createElement(s);
js.id = id;
js.src = "http://platform.twitter.com/widgets.js";
fjs.parentNode.insertBefore(js, fjs);
}
} (document, "script", "twitter-wjs");</script>
</body>
</html>