mirror of
https://github.com/photonstorm/phaser
synced 2024-11-22 04:33:31 +00:00
Added Body.updateCallback
This commit is contained in:
parent
a481f75e31
commit
d8991c5bc5
2 changed files with 8 additions and 1 deletions
|
@ -58,6 +58,8 @@ var Body = new Class({
|
|||
this.debugShowBody = world.defaults.debugShowBody;
|
||||
this.debugShowVelocity = world.defaults.debugShowVelocity;
|
||||
this.debugBodyColor = world.defaults.bodyDebugColor;
|
||||
|
||||
this.updateCallback;
|
||||
|
||||
// min 44 deg, max 136 deg
|
||||
this.slopeStanding = { min: 0.767944870877505, max: 2.3736477827122884 };
|
||||
|
@ -135,6 +137,11 @@ var Body = new Class({
|
|||
graphic.lineBetween(x, y, x + this.vel.x, y + this.vel.y);
|
||||
}
|
||||
}
|
||||
|
||||
if (this.updateCallback)
|
||||
{
|
||||
this.updateCallback(this);
|
||||
}
|
||||
},
|
||||
|
||||
skipHash: function ()
|
||||
|
|
|
@ -210,7 +210,7 @@ var World = new Class({
|
|||
}
|
||||
}
|
||||
|
||||
// Run collision against them all now they're in the new positions from the udpate
|
||||
// Run collision against them all now they're in the new positions from the update
|
||||
|
||||
for (i = 0; i < len; i++)
|
||||
{
|
||||
|
|
Loading…
Reference in a new issue