function(deltaTime) {
x = x * FACTOR; // FACTOR = 0.9
}
This function is called in a game loop. First assume that it's running at a constant 30 FPS, so deltaTime
is always 1/30.
Now the game is changed so deltaTime
isn't always 1/30 but becomes variable. How can I incorporate deltaTime
in the calculation of x
to keep the "effect per second" the same?
And what about
function(deltaTime) {
x += (target - x) * FACTOR; // FACTOR = 0.2
}