-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
34 lines (30 loc) · 816 Bytes
/
main.js
File metadata and controls
34 lines (30 loc) · 816 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 MenuScene from './menu.js';
import GameScene from './game.js';
import UIScene from './ui.js';
let yaGames = null;
export async function initYaGames() {
try {
yaGames = await YaGames.init();
} catch (e) {
console.log('YaGames init failed, running in stub mode', e);
}
return yaGames;
}
window.addEventListener('load', async () => {
await initYaGames();
const config = {
type: Phaser.AUTO,
width: 800,
height: 600,
parent: 'game-container',
physics: {
default: 'arcade',
arcade: {
debug: false
}
},
scale: { mode: Phaser.Scale.FIT, autoCenter: Phaser.Scale.CENTER_BOTH },
scene: [MenuScene, GameScene, UIScene]
};
new Phaser.Game(config);
});