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

@ -5,10 +5,20 @@ const Fixture = require('./fixture.js');
class Grapple extends Fixture {
constructor(mount, data) {
super(mount, data);
this.grapple = false;
}
fire() {
fire(value) {
if (this.state == 1) {
this.grapple.release();
this.state = 0;
} else {
let x = this.body.aim.x;
let y = this.body.aim.y;
this.state = 1;
this.grapple = this.body.world.spawner.spawnGrapple(this, x, y);
}
}
}