💻 Computer Science · Topic 73 of 80

Games and Simulation

Games use loops, events and physics simulations.

Interactive labDrag the mass or tweak the spring

About this topic

Video games and simulations are programs that model worlds and let users interact. A game loop runs many times a second: process input, update the game state (move characters, check collisions, apply rules and physics) and draw the next frame. A rate of 60 frames per second means each cycle must finish in about 16 milliseconds.

Games use many computing ideas: graphics rendering with the GPU, collision detection with geometry, artificial intelligence for opponents using pathfinding and decision rules, sound, networking for multiplayer, and data structures for inventories and maps. Simulations model real systems, such as weather, traffic, disease spread, bridges and flight training, by repeating small calculations over time steps with rules for how things change.

For example, a simple projectile simulation updates position and velocity each step using gravity. Simulations let people test dangerous or expensive ideas safely. A common misconception is that a simulation is exactly reality; it is a model with assumptions, so results depend on the quality of the rules and data. Another is that games are only entertainment, although they are used for education, training and research. Making a small game is an excellent way to practise programming.

Key ideas

  1. Game loop updates and draws
  2. Collision detection
  3. Randomness

Quick check

Use cases: where Games and Simulation helps

Computing ideas run phones, search engines, games and the wider internet.

Frequently asked questions

What is Games and Simulation?

Games use loops, events and physics simulations.

What will I learn in Games and Simulation?

Game loop updates and draws. Collision detection. Randomness.

Is Games and Simulation part of Computer Science?

Yes. It is one of 80 Computer Science topics on LearnViz HighSchoolEdu, with 3 key ideas, a live animation and a quick check.

Does the Games and Simulation lab work on a phone or tablet?

Yes. The animation resizes to fit your screen and supports touch, so you can drag, tap and slide with your finger.

How should I study Games and Simulation?

Read the summary and key ideas first, play with the interactive lab to see the idea in motion, then answer the quick check. If you get a question wrong, go back to the key idea it tests.

Do I need an account, and is my progress saved?

No account is needed. Marking a topic as learned is saved in your own browser, so it stays on that device and is not sent to a server.

More in Computer Science