-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathindex.ts
More file actions
25 lines (18 loc) · 760 Bytes
/
index.ts
File metadata and controls
25 lines (18 loc) · 760 Bytes
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
/// <reference path="../typings/browser.d.ts"/>
/// <reference path="../lib/phaser.d.ts"/>
import * as Phaser from 'phaser'
import {BootState} from './states/boot'
import {SplashState} from './states/splash'
import {GameState} from './states/game'
class Game extends Phaser.Game {
constructor () {
let width = document.documentElement.clientWidth > 768 ? 768 : document.documentElement.clientWidth
let height = document.documentElement.clientHeight > 1024 ? 1024 : document.documentElement.clientHeight
super(width, height, Phaser.AUTO, 'content', null)
this.state.add('Boot', BootState, false)
this.state.add('Splash', SplashState, false)
this.state.add('Game', GameState, false)
this.state.start('Boot')
}
}
new Game()