I don’t know if I’m explaining this right…
A computer can run logic at some speed based on how powerful the components of it are, so if it can perform the logic of something, for example, movement in a game, how does it know how much should be done based on its power, instead of essentially running in “fast-forward” or conversely in slow motion?
In: 1307
There’s a thing called the game loop.
Every loop, it does all the logic for the game and drawing onto the screen.
Faster computers will call this loop quicker because they can, slower computers will call it slower.
If you look at how much time has passed since the last time the loop happened, you know how much to move things on the screen.
So if your character moves 60 steps per second and half a second has occurred since the last loop, you should move the character 30 steps (half of 60).
This will keep fast and slow computers running at the same speed.
Latest Answers