Typically there’s a ‘game loop’ where a computer program will check everything going on and update the screen accordingly.
So, let’s say you’re playing pong. First it looks at the controllers, if they’re being pressed, it moves the paddles.
Then it checks to see if the ball is hitting any walls or a paddle. If not, it updates the position based on what direction it was moving. If it is hitting a paddle, it just reverses the direction and updates it. If it is behind a paddle, it removes the ball and prints ‘game over’ on the screen.
If loops through those checks/updates very quickly. At about 60 times a second, human eyes see that as ‘fluid motion’.
Every game you’ve ever played is doing a version of that. There’s a game loop where it checks your controls, checks the objects on the screen, then updates them.
Latest Answers