add boilerplate for mounts and fixtures
This commit is contained in:
parent
0ea163dfb7
commit
0a90b6b77a
15 changed files with 158 additions and 17 deletions
|
@ -11,11 +11,17 @@ class Body {
|
|||
this.r = 0;
|
||||
this.b2body = false;
|
||||
this.type = 'asteroid';
|
||||
this.mounts = [];
|
||||
this.health = 1;
|
||||
this.world = world;
|
||||
this.id = uuid.v4().slice(0, 8);
|
||||
}
|
||||
|
||||
destruct() {
|
||||
this.mounts.forEach(mount => mount.destruct());
|
||||
this.world.physics.remove(this);
|
||||
}
|
||||
|
||||
applyDelta() {
|
||||
this.world.applyDelta(this.id, this.packDelta());
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue