Jump to content
  • Advertisement

Archived

This topic is now archived and is closed to further replies.

Zoomby

problem with jump'n'run physics

This topic is 5605 days old which is more than the 365 day threshold we allow for new replies. Please post a new topic.

If you intended to correct an error in the post then please contact us.

Recommended Posts

hi! I have a problem with my jump''n''run game. When the player jumps it looks ok, but when he walks off a platform he''s falling too fast. When I set my numbers to smaller values, the player falls from a platform with a "normal" speed, but when he jumps he is slow like a feather. What is the problem? I do this basic calculations in the game: every frame: velY += gravity; when hitting a floor: velY = gravity; (velY is gravity as long as the player stands on something) when jumping velY -= 8 bye chris

Share this post


Link to post
Share on other sites
Advertisement
I assume VelY is the vertical velocity.

Since when you''re standing on something, VelY = 0 ( or else you''re going through the floor) this means Gravity = 0... That looks quite like a problem.

Do you mean by "when jumping" that you set the VelY to -8 when the jump starts? Or that you set it to -8 as long as the jump key is pressed?

Could you please post pseudo-code of what you do :

- Each frame
- When the jump command key is pressed

ToohrVyk
-------------
Extatica - a free 3d game engine
Available soon!
Click here to learn more

Share this post


Link to post
Share on other sites
hi, I found the mistake :-) I forgot to multiply my "jump power" (the vertical velocity) with the frametime.

bye
chris

Share this post


Link to post
Share on other sites

  • Advertisement
×

Important Information

By using GameDev.net, you agree to our community Guidelines, Terms of Use, and Privacy Policy.

Participate in the game development conversation and more when you create an account on GameDev.net!

Sign me up!