reorder and rename hardpoints and particles
This commit is contained in:
parent
d302bd4149
commit
ea533015ba
16 changed files with 65 additions and 64 deletions
25
server/game/room/world/body/hardpoint/grapple.js
Normal file
25
server/game/room/world/body/hardpoint/grapple.js
Normal file
|
@ -0,0 +1,25 @@
|
|||
'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;
|
Loading…
Add table
Add a link
Reference in a new issue