Dynamic body player and slopes

Discuss issues specific the Java port of Box2D
Cyraxx
Posts: 3
Joined: Tue Jul 08, 2014 11:53 pm

Dynamic body player and slopes

Postby Cyraxx » Wed Jul 09, 2014 12:01 am

Hi,
I have created a Box2D based map for my platformer using ChainShape wich has different angle slopes (no more than 45°).
My problem is the slope collision with my player. The player' body has 2 fixtures, a rectangle and a circle bellow it. Whenever I move the player (the method doesn't matter the results are the same) and I stop on the middle of a slope I slowly glide down. I managed to temporarly fix that but the main reason for this post is the fact that whenever I leave a slope I shoot out because I still have some impulse left from the previous movement. Same thing happens when I enter a downwards slope, or when I stop on a slope and I start moving again.

Entering / leaving the slope:
(The red lines are the desired movement, the black is the movement I have right now)
Image

Start moving on a slope:
(The red lines are the desired movement, the black is the movement I have right now)
Image

Could you please help me out with this problem? I don't mind if your answer is detailed either ;)
Thanks in advance!

irresistible force
Posts: 1991
Joined: Tue Jun 24, 2008 8:25 pm
Location: Tokyo
Contact:

Re: Dynamic body player and slopes

Postby irresistible force » Wed Jul 09, 2014 2:50 am

This thread may be relevant: viewtopic.php?f=3&t=9757


Return to “Java”



Who is online

Users browsing this forum: No registered users and 2 guests