Jump to content

Phaser 2.0.0 Arcade Physics Bug


Natman
 Share

Recommended Posts

When two bodies next to each other have the same height, forming a flat surface together, the player cannot walk across it. When he reaches the point where one body ends and the other begins, he stops as if blocked by a wall. You can see the bug in action in my game by waiting for two bricks to fall side by side, and trying to walk across them. Your player will stop:

 

http://nathanielnelson.com/webgames/BricketySplit/

 

I'm pretty sure there is no gap between the two bodies, either. They should form a continuous flat surface.

Link to comment
Share on other sites

Yes this is the classic toe-stubbing problem, you'll need to handle it in your code directly (or don't use arcade physics, which isn't advanced enough to cope with this). You could try to disable gravity on the player if they are 'touching.down'. That way they won't get pushed down into the bodies below. You'll need to reverse it as soon as they jump or move a certain distance away from where you disabled gravity of course.

Link to comment
Share on other sites

I solved it in my code by checking if the player's body is touching.left or touching.right and subtracting one from its y position if it is. This solution is fine for my game's purposes, the player just bounces up and down cutely when he hits a wall.  :)

Link to comment
Share on other sites

 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...