add lasers
This commit is contained in:
parent
cf4e8024af
commit
f87aa1446d
31 changed files with 298 additions and 125 deletions
|
@ -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);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue