How to make object jump in pygame also take gravity effect? | Sololearn: Learn to code for FREE!
New course! Every coder should learn Generative AI!
Try a free lesson
+ 2

How to make object jump in pygame also take gravity effect?

12th Feb 2019, 3:29 AM
Maninder $ingh
Maninder $ingh - avatar
2 Answers
+ 10
Hello, There's a formula to jump with gravity effect https://pythonspot.com/jump-and-run-in-pygame/
12th Feb 2019, 4:47 AM
just trying to think
just trying to think - avatar
+ 2
... while exit_condition: ... yspeed = 0 if jumped and on_ground: yspeed = 10 if not on_ground: yspeed -= 1 else: yspeed = 0 ... ...
12th Feb 2019, 8:02 AM
Seb TheS
Seb TheS - avatar