New answers tagged platformer
I was able to achieve a precise gravity simulation by applying the 'correction' said in this article: http://www.niksula.hut.fi/~hkankaan/Homepages/gravity.html Basicaly it consists in dividing the gravity by 2 in the very first frame/iteration when adding it to velocity.
It's because of the discreet time and the way you integrate. Because you step time forward at 1/50 of a second you're not guaranteed to hit the actual apex of 4.0, the delta is just not granular enough. (Try setting the delta time to 1/5000 and you'll see that it gets closer to 4, obviously that won't work for your game but it will show you the effect). ...
Did you try using a different power for the velocity or a combination of powers? Power 3 means that for small speed the friction is almost zero, eg 0.1^3=0.001. Drag from air flow is normally ~v^2 for higher and ~v for low speed so you could use a linear combination av^2+bv. Sliding friction is even independent of speed, so you could add an extra constant ...
Top 50 recent answers are included