reduce update packets sent

This commit is contained in:
Asraelite 2016-03-30 12:50:59 +01:00
parent d6daed2e9b
commit ef2d067b38
15 changed files with 67 additions and 14 deletions

View file

@ -57,7 +57,8 @@ class Ship extends Body {
this.thrust.left = packet.thrust[1];
this.thrust.right = packet.thrust[2];
if (packet.fire[1]) this.launchMissile();
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) {