-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathscript.js
34 lines (30 loc) · 855 Bytes
/
script.js
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
import TitleScene from './classes/TitleScene.js';
import GameScene from './classes/GameScene.js';
import GameOverScene from './classes/GameOverScene.js';
import HelpScene from './classes/HelpScene.js';
var config = {
type: Phaser.AUTO,
width: window.innerWidth,
height: window.innerHeight,
physics: {
default: 'arcade',
arcade: {
gravity: { y: 300 },
debug: false
}
}
};
/*
Game Scene
*/
var gameScene = new GameScene();
var titleScene = new TitleScene();
var gameOverScene = new GameOverScene();
var helpScene = new HelpScene();
var game = new Phaser.Game(config);
game.scene.add('titleScene', titleScene);
game.scene.add("game", gameScene);
game.scene.add("gameOver", gameOverScene);
game.scene.add("helpScene", helpScene);
// Start Title Scene
game.scene.start('titleScene');