This project has moved and is read-only. For the latest updates, please go here.

Platform Walking/Jumping Help

May 6, 2009 at 2:01 PM
I'm having trouble setting up a simple platform game scenario.

If I set the linearDragCoefficient up in such a way that my character moves at a constant speed, he also falls at a constant speed!  I want him to jump/fall realistically, but move left and right with a normal start/stop mechanic.  I can get one or the other set up, but not both.

Is this just a case of playing with the values until I get it right, or am I missing something?  Is there a formula for calculating these values I should be following?
May 6, 2009 at 8:11 PM
Fixed.  The trick was, unfortunately, to whack up the gravity, which made some of my forces a bit big, but its balanced finally now.

May 7, 2009 at 12:11 PM
if you using a physics only approach you will probably have to tweak friction and linear drag to. your character will be slowed down by friction if he is on ground and as soon as you jump the sideway forces will become significantly bigger.

@admins: is there a way to make a sticky thread about platformers as this topic pops up again and again
May 7, 2009 at 3:11 PM
@yobiv: Nope, unfortunately not. Would like that functionality too. + get my link button back. ;)
May 7, 2009 at 6:36 PM
Yeah Codeplex is really great in some ways and really dumb in others.
May 22, 2009 at 2:34 PM

What about setting up a wiki page for these common questions and answers? This would also pull together and collate the various concepts into one place, rather than having to sort through the threads? I've been looking through various threads now and still havent figured out a 'complete' answer on how to detect if a player is on the ground. A wiki page could describe all the various theories and pull together the information allowing a better understanding and bigger picture rather than trying to make sense of a couple of snippets of code.

May 22, 2009 at 6:57 PM

I've created a tutorials section. It will contain the common questions, howto's and the like:


Right now it contains only 3 posts created by yobiv. He have also created some howto's, but I have not had the time to update the list.
If find any posts that you think should be included in the list, contact me or write them in the comment section of the wiki page, and I will add them.