-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
35 lines (32 loc) · 845 Bytes
/
main.js
File metadata and controls
35 lines (32 loc) · 845 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
31
32
33
34
35
import Phaser from 'phaser';
import TestScene from './src/scenes/TestScene.mjs';
import UIPlugin from 'phaser3-rex-plugins/templates/ui/ui-plugin.js';
const screenHeight = screen.availHeight - 200;
const screenWidth = screen.availWidth;
var config = {
type: Phaser.AUTO,
width: 800,
height: 600,
pixelArt: true,
backgroundColor: '#121215',
scene: [TestScene],
physics: {
default: "arcade",
},
plugins: {
scene: [{
key: 'rexUI',
plugin: UIPlugin,
mapping: 'rexUI'
},
// ...
]
}
// plugins: {
// scene: [
// { key: 'DebugDrawPlugin', plugin: DebugDrawPlugin, mapping: 'debugDraw' }
// ]
// }
};
const game = new Phaser.Game(config);
game.scene.start('test', { image: '/public/images/pizza/pizza.png', x: 400, y: 300 });