-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.js
More file actions
28 lines (19 loc) · 667 Bytes
/
main.js
File metadata and controls
28 lines (19 loc) · 667 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
import { MyApp } from './MyApp.js';
import { MyGuiInterface } from './MyGuiInterface.js';
import { MyContents } from './MyContents.js';
import { GameStateManager, GameStates } from './GameStateManager.js';
async function main() {
const app = new MyApp();
app.init();
const gameStateManager = new GameStateManager();
const contents = new MyContents(app, gameStateManager);
app.setContents(contents);
const gui = new MyGuiInterface(app);
gui.setContents(contents);
gui.init();
app.setGui(gui);
gameStateManager.setState(GameStates.INITIAL);
// main animation loop - calls every 50-60 ms.
app.render();
}
main();