Code: Select all
thisTime = SDL_GetTicks();
delta = (thisTime - lastTime) / 1000.0f;
lastTime = thisTime;
update(delta);
Then, when I move something
Code: Select all
changeInPosition = changeInPosition * dt; //dt = delta
ballPosition = ballPosition + changeInPosition; //both are vectors
However, if I put a high value for the velocity, like 100, it moves as if I were just moving it one pixel every frame. By setting it to 100, I'm telling it to move 100 pixels every second correct?
Is it normal to have high values such as 100 for medium speed movement when you use delta timing?
Also, say I wanted to wait for 5 seconds before doing something, couldn't I just keep accumulating delta until it is greater than or equal to 5.0? I've tried this, but it doesn't work at all, leading me to suspect that I may have to do some multiplication of the deltas...