Add button interaction

This commit is contained in:
asraelite 2018-03-02 22:30:26 +00:00
parent 6223b35536
commit 4a253b0184
12 changed files with 247 additions and 23 deletions

View file

@ -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();
}