-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathapp.js
More file actions
22 lines (18 loc) · 975 Bytes
/
app.js
File metadata and controls
22 lines (18 loc) · 975 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
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(800, 600, 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('Gender', BasicGame.Gender);
game.state.add('Color', BasicGame.Color);
game.state.add('FirstLvl', BasicGame.FirstLvl);
game.state.add('Success', BasicGame.Success);
game.state.add('Failure', BasicGame.Failure);
game.state.add('Bonus', BasicGame.Bonus);
// Now start the Boot state.
game.state.start('Boot');
};