mirror of
https://github.com/photonstorm/phaser
synced 2024-11-27 23:20:59 +00:00
Merge pull request #5242 from samme/fix/collide-with-friction
Fix collisions for objects moved by friction
This commit is contained in:
commit
8db2543e27
2 changed files with 4 additions and 0 deletions
|
@ -64,6 +64,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias)
|
|||
if (body2.moves)
|
||||
{
|
||||
body1.y += (body2.y - body2.prev.y) * body2.friction.y;
|
||||
body1._dy = body1.y - body1.prev.y;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -75,6 +76,7 @@ var SeparateX = function (body1, body2, overlapOnly, bias)
|
|||
if (body1.moves)
|
||||
{
|
||||
body2.y += (body1.y - body1.prev.y) * body1.friction.y;
|
||||
body2._dy = body2.y - body2.prev.y;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
|
@ -64,6 +64,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias)
|
|||
if (body2.moves)
|
||||
{
|
||||
body1.x += (body2.x - body2.prev.x) * body2.friction.x;
|
||||
body1._dx = body1.x - body1.prev.x;
|
||||
}
|
||||
}
|
||||
else
|
||||
|
@ -75,6 +76,7 @@ var SeparateY = function (body1, body2, overlapOnly, bias)
|
|||
if (body1.moves)
|
||||
{
|
||||
body2.x += (body1.x - body1.prev.x) * body1.friction.x;
|
||||
body2._dx = body2.x - body2.prev.x;
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue