add start of gun support
This commit is contained in:
parent
444533ce85
commit
65f78ec3ac
19 changed files with 141 additions and 29 deletions
36
server/game/room/world/missile.js
Normal file
36
server/game/room/world/missile.js
Normal file
|
@ -0,0 +1,36 @@
|
|||
'use strict';
|
||||
|
||||
const Body = require('./bodies.js');
|
||||
|
||||
class Missile extends Body {
|
||||
constructor(world, source) {
|
||||
super(world);
|
||||
|
||||
this.source = source;
|
||||
this.player = source.player;
|
||||
|
||||
this.frame = [[[0, 0], [0, 10], [3, 10], [3, 0]]];
|
||||
}
|
||||
|
||||
detonate() {
|
||||
// Blow up stuff.
|
||||
this.world.removeBody(this);
|
||||
}
|
||||
|
||||
packTypeDelta() {
|
||||
return [];
|
||||
}
|
||||
|
||||
packFull() {
|
||||
return {
|
||||
type: 'missile',
|
||||
id: this.id,
|
||||
source: this.source.id,
|
||||
team: this.player.team,
|
||||
frame: this.frame,
|
||||
delta: this.packDelta()
|
||||
};
|
||||
}
|
||||
}
|
||||
|
||||
module.exports = Projectile;
|
Loading…
Add table
Add a link
Reference in a new issue