-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathgame.js
35 lines (29 loc) · 977 Bytes
/
game.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
35
require('pixi')
require('p2')
require('phaser')
import loadingScreen from './states/loadingScreen'
import caveState from './states/caveState'
import fantasyState from './states/fantasyState'
import spaceState from './states/spaceState'
import arenaState from './states/arenaState'
/* global StackQuest, Phaser */
class StackQuest extends Phaser.Game {
// Initialize game
constructor() {
const width = 960
const height = 540
super(width, height, Phaser.AUTO, 'game-container')
// Add all the states
this.state.add('loadingScreen', loadingScreen)
this.state.add('caveState', caveState)
this.state.add('fantasyState', fantasyState)
this.state.add('spaceState', spaceState)
this.state.add('arenaState', arenaState)
}
// Start StackQuest Game
startGame(character) {
this.state.start('loadingScreen', true, false, character)
// this.state.start(character.currentMap, true, false, character)
}
}
export default StackQuest