more explanation
This commit is contained in:
parent
26c99a9794
commit
5b86ef5c57
|
|
@ -88,8 +88,9 @@ int main(void)
|
||||||
SetTargetFPS(currentFps);
|
SetTargetFPS(currentFps);
|
||||||
}
|
}
|
||||||
|
|
||||||
// Use of delta time to make the circle look like it's moving at a "consistent" speed regardless of FPS.
|
|
||||||
// GetFrameTime() returns the time it took to draw the last frame, in seconds (usually called delta time).
|
// GetFrameTime() returns the time it took to draw the last frame, in seconds (usually called delta time).
|
||||||
|
// Uses the delta time to make the circle look like it's moving at a "consistent" speed regardless of FPS.
|
||||||
|
|
||||||
// Multiply by 6.0 (an arbitrary value) in order to make the speed visually closer to the other circle (at 60 fps), for comparison.
|
// Multiply by 6.0 (an arbitrary value) in order to make the speed visually closer to the other circle (at 60 fps), for comparison.
|
||||||
deltaX += GetFrameTime() * 6.0 * speed;
|
deltaX += GetFrameTime() * 6.0 * speed;
|
||||||
// This circle can move faster or slower visually depending on the FPS.
|
// This circle can move faster or slower visually depending on the FPS.
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue
Block a user