fix projectiles

This commit is contained in:
Asraelite 2016-03-29 01:44:02 +01:00
parent 0906441246
commit 4f42723f4a
7 changed files with 20 additions and 8 deletions

View file

@ -11,8 +11,8 @@ class Body {
this.fixtures = data.fixtures;
this.b2body = false;
this.updated = 0;
game.world.update(data.delta);
this.update(data.delta.slice(1));
this.com = {
x: 0,

View file

@ -44,10 +44,9 @@ class World {
};
update(data) {
let array = new Float32Array(data);
let i = 0;
while (i < array.length) {
let id = array[i++];
while (i < data.length) {
let id = data[i++];
let body = this.bodies[id];
if (!body) {
@ -55,7 +54,7 @@ class World {
return;
}
body.update(array.slice(i, i + body.interface.size));
body.update(data.slice(i, i + body.interface.size));
i += body.interface.size;
}
};