How Do Video Games Work?

Discover the computer science behind video games!

What is a Game Loop?

A Game Loop is a process that repeatedly runs while a game is active.

Input
→
Update
→
Render

This process repeats many times every second.

How does collision detection work?

Collision detection is a process used to determine whether two objects in a game are touching or overlapping.

Try Collision detection!

what do the CPU and GPU do?

The CPU is responsible for calculation and game logic, whereas the GPU is responsible for rendering graphics.

For example, the CPU checks whether the purple character collides with the orange obstacle by comparing their positions.

The GPU helps render the character and obstacle on the screen.GPUs are designed to perform many calculations in parallel, making them particularly efficient at rendering graphics.