Control jump in platformer

Topics: User Forum
Jan 13, 2014 at 10:26 PM

I am new to farseer and building a prototype for a platformer. I am using the apporach with the wheel and a rectangle which works nice so far (

My problem is that I dont understand how to control the character when jumping, you should have the option to move right or left. I had a look to some tutorials and they always manipulate the velocity manually, but this does not seems to be a robust way for me. I want a very fast speed up and slow down, but the only option I found is to use a very high value for the force and a much higher linear-damping. But this would mean to edit the gravity as well and to play around with high values for bumpers and so on as well. Does not sound so good.

What is the best apprach here?
Apr 12, 2014 at 9:47 PM
The reason you are not able to move the player in the air is that the wheel only moves when touching the ground. If the wheel has no collision with the ground it cannot move its own body.

To make it move you would need to apply force or impulse for it to move in midair.
example: wheel.body.ApplyLinearImpulse(.3f);

Although the problem I am having with this sample is getting it to stop moving after impulse or force is applied.