-
-
Notifications
You must be signed in to change notification settings - Fork 17
Expand file tree
/
Copy pathgame.ts
More file actions
21 lines (19 loc) · 562 Bytes
/
game.ts
File metadata and controls
21 lines (19 loc) · 562 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
import * as Phaser from 'phaser'
import { enable3d, Canvas } from '@enable3d/phaser-extension'
import MainScene from './scenes/mainScene'
import PreloadScene from './scenes/preloadScene'
const config: Phaser.Types.Core.GameConfig = {
type: Phaser.WEBGL,
transparent: true,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
width: 1280,
height: 720
},
scene: [PreloadScene, MainScene],
...Canvas()
}
window.addEventListener('load', () => {
enable3d(() => new Phaser.Game(config)).withPhysics('assets/ammo')
})