Take the 2-minute tour ×
Game Development Stack Exchange is a question and answer site for professional and independent game developers. It's 100% free, no registration required.

So i smashed my brains trying to make my character move. As i wanted later in the game to add explosions and bullets it wasn't a good idea to mess with the velocity and the forces/impulses didn't work as i expected so something stuck in my mind: Is it a good idea to put at his bottom a wheel(circle) which is invisible to the player that will do the movement by rotation? I will attach this to my main body with a revolute joint but i don't really know how to make the main body and wheel body to don't collide one with each other since funny things can happen. What is your oppinion?

share|improve this question
add comment

1 Answer

up vote 3 down vote accepted

: Is it a good idea to put at his bottom a wheel(circle) which is invisible to the player that will do the movement by rotation?

That is exactly what you should. I once wrote a tutorial on it for C#/XNA and Farseer, but you should be able to adopt it easily to Java and Box2D (Farseer is based on Box2D).

Here's the tutorial:

http://www.sgtconker.com/2010/09/article-xna-farseer-platform-physics-tutorial/

The end result should be something like this: Platformer

And a video: http://www.youtube.com/watch?v=iC_Y9Tq5JeU&feature=player_embedded

share|improve this answer
    
Thank you. I know what Farseer is, i have a little experience with XNA. Thank for your advice and tutorial. :D –  Romeo Apr 7 '12 at 19:49
    
I don't imagine that this would produce the best results for anyone trying to make an old-school style platformer. The rounded shape will not match the visual shape of the character, so the character will fall/slide/sink when standing near ledges. A large part of the design of a platformer's feel and mechanics is getting the sprite's feet to match the bounding shape that the character "stands" with. –  Sean Middleditch Apr 8 '12 at 10:33
    
That's where the two rays come in. Also the wheel has almost infinite friction and the body can not tilt so you would only appear slightly lower (depending on the wheel size) when near an edge, which is a good visual indicator. I'm afraid this is a very common technique. I would also argue that a large part of game design is faking stuff so that it feels right, but that this doesn't mean that it is right :). –  Roy T. Apr 9 '12 at 21:14
    
@RoyT. is there a name for this type of character movement? struggling to find more info on it –  eskimo Dec 4 '13 at 13:53
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.