This repository has been archived by the owner on Dec 13, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 117
/
index.html
52 lines (43 loc) · 1.55 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
<!DOCTYPE HTML>
<html>
<head>
<meta charset="UTF-8" />
<title>Phaser Basic Project Template</title>
<link rel="stylesheet" href="css/game.css" type="text/css" />
<script src="js/lib/phaser.js"></script>
<script src="js/src/Boot.js"></script>
<script src="js/src/Preloader.js"></script>
<script src="js/src/MainMenu.js"></script>
<script src="js/src/GameOver.js"></script>
<script src="js/src/Congratulations.js"></script>
<script src="js/src/Game.js"></script>
<style>
html, body {
background: #000;
display: block;
margin: 0;
padding: 0;
}
</style>
</head>
<body >
<div id="gameContainer"></div>
<script type="text/javascript">
window.onload = function() {
// Create your Phaser game and inject it into the gameContainer div.
// We did it in a window.onload event, but you can do it anywhere (requireJS load, anonymous function, jQuery dom ready, - whatever floats your boat)
var game = new Phaser.Game(320, 416, Phaser.AUTO, "gameContainer");
// 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('GameOver', BasicGame.GameOver);
game.state.add('Congratulations', BasicGame.Congratulations);
game.state.add('Game', BasicGame.Game);
// Now start the Boot state.
game.state.start('Boot');
};
</script>
</body>
</html>