improcket/js/game.mjs
2018-03-02 17:23:19 +00:00

26 lines
445 B
JavaScript

import * as graphics from './graphics/index.mjs';
import * as gui from './gui/index.mjs';
export let game;
export async function init() {
game = {
state: {
room: 'menu',
paused: false
}
};
graphics.init();
gui.init();
// Recursive `requestAnimationFrame` can cause problems with Parcel.
while(true) {
await tick();
await new Promise(res => requestAnimationFrame(res));
}
}
async function tick() {
graphics.render();
}