Natman Posted March 18, 2014 Share Posted March 18, 2014 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 More sharing options...
valueerror Posted March 18, 2014 Share Posted March 18, 2014 i had to read the source to find out how to jump ^^ Z it is... Natman 1 Link to comment Share on other sites More sharing options...
rich Posted March 18, 2014 Share Posted March 18, 2014 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 More sharing options...
Natman Posted March 20, 2014 Author Share Posted March 20, 2014 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 More sharing options...
Recommended Posts