Skip to content

Commit 215632c

Browse files
committed
Merge pull request phaserjs#261 from cocoademon/platform_riding_fix
Fix riding on platforms
2 parents 9988a2f + 56389fc commit 215632c

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

src/physics/arcade/ArcadePhysics.js

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -961,9 +961,9 @@ Phaser.Physics.Arcade.prototype = {
961961
body1.velocity.y = this._velocity2 - this._velocity1 * body1.bounce.y;
962962

963963
// This is special case code that handles things like horizontal moving platforms you can ride
964-
if (body2.active && body2.moves && (body1.deltaY() > body2.deltaY()))
964+
if (body2.moves)
965965
{
966-
body1.x += body2.x - body2.lastX;
966+
body1.x += body2.x - body2.preX;
967967
}
968968
}
969969
else if (!body2.immovable)
@@ -972,9 +972,9 @@ Phaser.Physics.Arcade.prototype = {
972972
body2.velocity.y = this._velocity1 - this._velocity2 * body2.bounce.y;
973973

974974
// This is special case code that handles things like horizontal moving platforms you can ride
975-
if (body1.sprite.active && body1.moves && (body1.deltaY() < body2.deltaY()))
975+
if (body1.moves)
976976
{
977-
body2.x += body1.x - body1.lastX;
977+
body2.x += body1.x - body1.preX;
978978
}
979979
}
980980
body1.updateHulls();

0 commit comments

Comments
 (0)