mirror of
https://github.com/photonstorm/phaser
synced 2024-11-24 05:33:35 +00:00
Gravity vars
This commit is contained in:
parent
8373936896
commit
6462e18527
1 changed files with 6 additions and 5 deletions
|
@ -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)
|
||||||
|
|
Loading…
Reference in a new issue