-
Notifications
You must be signed in to change notification settings - Fork 5
/
game.html
68 lines (59 loc) · 1.6 KB
/
game.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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Break a Pod</title>
<script src="phaser.min.js"></script>
<script src="phaser-debug.js"></script>
<script src="Boot.js"></script>
<script src="Preloader.js"></script>
<script src="MainMenu.js"></script>
<script src="Game.js"></script>
<script src="Lose.js"></script>
<script src="Instructions.js"></script>
<script src="environments.js"></script>
<style>
body {
margin: 0;
padding: 0;
}
</style>
</head>
<body>
<script type="text/javascript">
window.onload = function() {
var game = new Phaser.Game(800, 600, Phaser.AUTO, 'Break a pod!');
// setup the global game data object
game['GameData'] = {
'playedBefore':false,
'cLevel': 1,
'startingEnvironment': 1,
'baseLevelLength': '60000',
'death_speed': 50,
'min_speed': 200,
'max_speed': 5000,
'environments': environments,
'currentStageScore':0,
'score':0,
'distanceFromEnd': 2000,
'lives': 3,
'currentLives': 3
};
game['SoundManager'] = {
'music': null
}
// Add the States your game has.
// You don't have to do this in the html, it could be done in your Boot state too, but for simplicity I'll keep it here.
game.state.add('Boot', BasicGame.Boot);
game.state.add('Preloader', BasicGame.Preloader);
game.state.add('MainMenu', BasicGame.MainMenu);
game.state.add('Game', BasicGame.Game);
game.state.add('Win', BasicGame.Win);
game.state.add('Lose', BasicGame.Lose);
game.state.add('Instructions', BasicGame.Instructions);
// Now start the Boot state.
game.state.start('Boot');
};
</script>
</body>
</html>