add lasers

This commit is contained in:
Asraelite 2016-03-30 19:15:06 +01:00
parent cf4e8024af
commit f87aa1446d
31 changed files with 298 additions and 125 deletions

View file

@ -58,26 +58,12 @@ class Ship extends Body {
this.thrust.right = packet.thrust[2];
packet.fire.forEach((m, i) => m ? this.mounts[i].fire(m) : 0);
if (packet.fire[0] && this.grapple) {
this.grapple.release();
} else if (packet.fire[0] && !this.grapple) {
if (this.grapple) {
this.grapple.retract();
} else {
this.launchGrapple(this.aim.x, this.aim.y);
}
}
}
launchMissile() {
this.world.spawner.spawnMissile(this);
}
launchGrapple(x, y) {
this.grapple = this.world.spawner.spawnGrapple(this, x, y);
}
tickType() {
if (this.thrust.forward) {
let power = this.power.forward;