Platform movement, no sliding when walking uphill.

purplelava

  • Posts: 82
I would like the character in my platform game to NOT slide down when walking up or down a slope, while preserving the gravity direction to down. Basically the same behavior I think Mario games have, or Yoshi's Island.

I haven't succeded in accomplishing this by playing with friction or anything else. How would I go not making the player slide down a slope due to gravity? Would I have to ditch Box2D and gravity entirely?

gurigraphics

  • Posts: 690
If directional control is released
And character colide with x or enter in region y
Then deactivate gravity.

If directional control is pressed
Then activate gravity.

purplelava

  • Posts: 82
I *think* I've tried something like that and it was too clumsy, didn't work properly. But I'll try again, thanks for your reply.