Add ship movement

This commit is contained in:
asraelite 2018-03-03 15:58:51 +00:00
parent 09b3df649c
commit 4959519f39
15 changed files with 278 additions and 77 deletions

View file

@ -4,6 +4,8 @@ import * as assets from '../assets.mjs';
import * as input from '../input.mjs';
import * as world from '../world/index.mjs';
import * as events from './events.mjs';
import * as control from './control.mjs';
import * as player from './player.mjs';
export let state;
@ -35,11 +37,16 @@ export function changeView(view) {
if (view == 'game') {
world.init();
player.init();
}
}
async function tick() {
if (state.view == 'game') world.tick();
if (state.view == 'game') {
world.tick();
control.tick();
}
gui.tick();
graphics.render();
input.tick();