wingbase/server/game/room/world/body/turret/grapple.js
2016-03-30 20:40:05 +01:00

25 lines
448 B
JavaScript

'use strict';
const Fixture = require('./fixture.js');
class Grapple extends Fixture {
constructor(mount, data) {
super(mount, data);
this.grapple = false;
}
fireType(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);
}
}
}
module.exports = Grapple;