Typical Platformer Physics
Posted: Mon Mar 23, 2009 5:25 pm
Hello,
I've come to LOVE through wanting to create some little games and so far I am enjoying the engine. I'm creating a platformer and want to know how I can use box2D for gravity and jumping but to have no friction or rotational velocity when trying to move the character sideways as he walks. The problems I have encountered when trying to use a rectangle body shape for my character's bounding box is that it has friction with the ground and falls over if i try to apply a sideways force. What is the best way to move my character along the floor? The best solution I've come up with so far is to use a circular body shape, but that will mean: a) the bounding box is the wrong shape, and b) if he's ever stood on a sloping floor he will roll down it.
Any hints you can give me will be very welcome,
Thankyou.
I've come to LOVE through wanting to create some little games and so far I am enjoying the engine. I'm creating a platformer and want to know how I can use box2D for gravity and jumping but to have no friction or rotational velocity when trying to move the character sideways as he walks. The problems I have encountered when trying to use a rectangle body shape for my character's bounding box is that it has friction with the ground and falls over if i try to apply a sideways force. What is the best way to move my character along the floor? The best solution I've come up with so far is to use a circular body shape, but that will mean: a) the bounding box is the wrong shape, and b) if he's ever stood on a sloping floor he will roll down it.
Any hints you can give me will be very welcome,
Thankyou.