add basic missiles

This commit is contained in:
Asraelite 2016-03-24 18:42:11 +00:00
parent 21a30ad212
commit ac089f3e8e
19 changed files with 215 additions and 85 deletions

View file

@ -18,11 +18,13 @@ class Game {
this.connected = false;
this.state = 'connecting';
this.pingMode = 'fast';
this.input = new Input();
this.net = new Net();
this.world = new World();
this.renderer = new Renderer();
this.player = new Player();
}
tick() {
@ -30,9 +32,10 @@ class Game {
var ship = this.world ? this.world.playerShip : false;
if(ship) {
ship.move = [87, 65, 68].map(k => this.input.keys.held[k] || false);
ship.updateMove();
if(this.player.ship) {
let delta = this.player.packDelta();
if (delta)
game.net.sendUpdate(delta);
}
this.input.clear();