Add ship movement
This commit is contained in:
parent
09b3df649c
commit
4959519f39
15 changed files with 278 additions and 77 deletions
|
@ -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();
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue