-
-
Notifications
You must be signed in to change notification settings - Fork 171
/
game.ts
47 lines (42 loc) · 992 Bytes
/
game.ts
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
36
37
38
39
40
41
42
43
44
45
46
47
/**
* @author Digitsensitive <digit.sensitivee@gmail.com>
* @copyright 2018 Digitsensitive
* @description Coin Runner
* @license Digitsensitive
*/
/// <reference path="../../phaser.d.ts"/>
import "phaser";
import { GameScene } from "./scenes/gameScene";
// main game configuration
const config: GameConfig = {
title: "Coin Runner",
url: "https://github.com/digitsensitive/phaser3-typescript",
version: "1.0",
width: 768,
height: 576,
type: Phaser.AUTO,
parent: "game",
scene: {
GameScene
},
input: {
keyboard: true,
mouse: false,
touch: false,
gamepad: false
},
backgroundColor: "#3A99D9",
pixelArt: false
};
// game class
export class Game extends Phaser.Game {
constructor(GameConfig: config) {
super(config);
this.scene.add("GameScene", GameScene, false);
this.scene.start("GameScene");
}
}
// when the page is loaded, create our game instance
window.onload = () => {
var game = new Game(config);
};