I'm using SDL to make a game and I'm using frame independent movement, everything works fine with no gravity or acceleration:
boxOffsetY += yVel * ( DELTA.get_ticks() / 1000.f );
The box moves accordingly, no matter what frame rate i use.
But when i try to add gravity:
yVel += dropSpeed * ( DELTA.get_ticks() / 1000.f );
I add this line first.
boxOffsetY += yVel * ( DELTA.get_ticks() / 1000.f );
And just like before I add this line later.
I've tried various methods but none of them seem to work properly.
Doing this based on Lazy Foo's tutorial: http://lazyfoo.net/SDL_tutorials/lesson32/index.php