Gravity vars

This commit is contained in:
Richard Davey 2019-03-19 23:21:06 +00:00
parent 8373936896
commit 6462e18527

View file

@ -1187,13 +1187,14 @@ var World = new Class({
if (body.allowGravity) if (body.allowGravity)
{ {
// var worldBlocked = body.worldBlocked; var gravityX = (this.gravity.x + body.gravity.x) * delta;
var gravityY = (this.gravity.y + body.gravity.y) * delta;
body._gx = (this.gravity.x + body.gravity.x) * delta; velocityX += gravityX;
body._gy = (this.gravity.y + body.gravity.y) * delta; velocityY += gravityY;
velocityX += body._gx; body._gx = gravityX;
velocityY += body._gy; body._gy = gravityY;
} }
if (accelerationX) if (accelerationX)