add boilerplate for mounts and fixtures

This commit is contained in:
Asraelite 2016-03-27 15:08:49 +01:00
parent 0ea163dfb7
commit 0a90b6b77a
15 changed files with 158 additions and 17 deletions

View file

@ -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());
}