How the hell do video games work?

336 views

I just don’t understand any of it, I play them all day yet I have no understanding of what it is or how it works. The people that make these things must be the smartest people.

In: 0

7 Answers

Anonymous 0 Comments

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.

You are viewing 1 out of 7 answers, click here to view all answers.