-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathGTE.ts
More file actions
30 lines (25 loc) · 933 Bytes
/
GTE.ts
File metadata and controls
30 lines (25 loc) · 933 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
26
27
28
29
30
/// <reference path = "lib/phaser.d.ts"/>
///<reference path="src/Controller/Boot.ts"/>
///<reference path="src/Controller/MainScene.ts"/>
///<reference path="src/Menus/TopMenu/TopMenu.ts"/>
module GTE {
class GTE extends Phaser.Game {
game: Phaser.Game;
constructor(width?: number, height?: number) {
super(width, height, Phaser.CANVAS, 'phaser-div', null, false, true);
this.game = this;
this.game.state.add("Boot", Boot, false);
this.game.state.add("MainScene", MainScene, false);
this.game.state.start("Boot");
}
}
window.onload = () => {
let width = window.innerWidth * devicePixelRatio;
let height = window.innerHeight * devicePixelRatio;
if (width > 1920) {
width = 1920;
height = 1920 / window.innerWidth * window.innerHeight;
}
new GTE(width, height);
}
}