Add button interaction
This commit is contained in:
parent
6223b35536
commit
4a253b0184
12 changed files with 247 additions and 23 deletions
28
js/game.mjs
28
js/game.mjs
|
@ -1,28 +0,0 @@
|
|||
import * as graphics from './graphics/index.mjs';
|
||||
import * as gui from './gui/index.mjs';
|
||||
import * as assets from './assets.mjs';
|
||||
|
||||
export let game;
|
||||
|
||||
export async function init() {
|
||||
game = {
|
||||
state: {
|
||||
room: 'menu',
|
||||
paused: false
|
||||
}
|
||||
};
|
||||
|
||||
graphics.init();
|
||||
await assets.init();
|
||||
gui.init();
|
||||
|
||||
// Recursive `requestAnimationFrame` can cause problems with Parcel.
|
||||
while(true) {
|
||||
await tick();
|
||||
await new Promise(res => requestAnimationFrame(()=>{}));
|
||||
}
|
||||
}
|
||||
|
||||
async function tick() {
|
||||
graphics.render();
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue