generated from UNRaf-PROGRAMACION/Phaser3-Template
-
Notifications
You must be signed in to change notification settings - Fork 2
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (32 loc) · 709 Bytes
/
main.js
File metadata and controls
34 lines (32 loc) · 709 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
import HelloWorldScene from "./scenes/HelloWorldScene.js";
// Create a new Phaser config object
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
scale: {
mode: Phaser.Scale.FIT,
autoCenter: Phaser.Scale.CENTER_BOTH,
min: {
width: 800,
height: 600,
},
max: {
width: 1600,
height: 1200,
},
},
physics: {
default: "arcade",
arcade: {
gravity: { y: 200 },
debug: true,
},
},
// List of scenes to load
// Only the first scene will be shown
// Remember to import the scene before adding it to the list
scene: [HelloWorldScene],
};
// Create a new Phaser game instance
window.game = new Phaser.Game(config);