-
Notifications
You must be signed in to change notification settings - Fork 0
/
index.ts
35 lines (30 loc) · 802 Bytes
/
index.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
import $ from "phaser";
import { Preloader } from "./src/scene/Preloader";
import { Start } from "./src/scene/Start";
import { Runner } from "./src/scene/Runner";
document.getElementById("game")?.replaceChildren();
const square_size: number = 400; // Math.min(window.innerHeight, window.innerWidth) * 0.9;
const runnerConfig: Phaser.Types.Core.GameConfig = {
type: Phaser.AUTO,
width: square_size,
height: square_size,
parent: "game",
scene: [Preloader, Start, Runner],
physics: {
default: "arcade",
arcade: {
debug: false,
},
},
render: {
pixelArt: true,
antialias: false,
},
scale: {
parent: "game",
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
autoRound: true,
},
};
const runner = new Phaser.Game(runnerConfig);