mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Gravity stored in properties. Intersects padding removed.
This commit is contained in:
parent
1306ad2f4a
commit
728a6da8e6
1 changed files with 6 additions and 11 deletions
|
@ -1187,18 +1187,13 @@ var World = new Class({
|
||||||
|
|
||||||
if (body.allowGravity)
|
if (body.allowGravity)
|
||||||
{
|
{
|
||||||
var gravityX = (this.gravity.x + body.gravity.x) * delta;
|
// var worldBlocked = body.worldBlocked;
|
||||||
var gravityY = (this.gravity.y + body.gravity.y) * delta;
|
|
||||||
|
|
||||||
if (gravityX < 0 && !body.worldBlocked.left || gravityX > 0 && !body.worldBlocked.right)
|
body._gx = (this.gravity.x + body.gravity.x) * delta;
|
||||||
{
|
body._gy = (this.gravity.y + body.gravity.y) * delta;
|
||||||
velocityX += gravityX;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (gravityY > 0 && !body.worldBlocked.down || gravityY < 0 && !body.worldBlocked.up)
|
velocityX += body._gx;
|
||||||
{
|
velocityY += body._gy;
|
||||||
velocityY += gravityY;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
|
|
||||||
if (accelerationX)
|
if (accelerationX)
|
||||||
|
@ -1610,7 +1605,7 @@ var World = new Class({
|
||||||
|
|
||||||
if (!body1.isCircle && !body2.isCircle)
|
if (!body1.isCircle && !body2.isCircle)
|
||||||
{
|
{
|
||||||
return IntersectsRect(body1, body2, 1);
|
return IntersectsRect(body1, body2);
|
||||||
}
|
}
|
||||||
else if (body1.isCircle)
|
else if (body1.isCircle)
|
||||||
{
|
{
|
||||||
|
|
Loading…
Reference in a new issue