#I need a help

5 messages · Page 1 of 1 (latest)

whole osprey
#

Gravity is an acceleration, not a speed (this is true in real life too, haha)

#

when you set gravity to 0, it means you've stopped accelerating, your speed stops increasing, but it doesn't set your speed to 0

#

additionally, your check to see if you hit the ground happens too late, only when y + 1 sees ground

#

so if you're moving faster than 1 pixel per frame you'll sink into the ground before this code runs

#

so, this will never be pixel perfect without loops or without the built in speed system, but we can get kinda close by changing line 14 to check at y + vspeed, and by adding a vspeed = 0; line right after gravity = 0;