Getting Started with C++: First Steps ยท Lesson 1 ยท 3 minutes
Fast Game Frames
State how many times a game loop runs per second.
Play this lesson in your browser. No account needed.
A World in Motion
Elena makes a 3D game. To look smooth, games draw 60 frames each second.

The Constant Loop
A game runs a game loop nonstop. It updates the world and draws, even with no buttons pressed.

What does Elena's game loop do if the player presses nothing?
- It keeps updating and drawing frames.
- It sleeps until a button is clicked.
Answer: It keeps updating and drawing frames.
A game loop runs continuously to move enemies and draw the screen.
The 16 Millisecond Budget
To draw 60 frames in one second, each frame has only 16 milliseconds.

Speed up Elena's loop to reach at least 60 frames per second.
This one uses your voice or your writing. It is in the Breni app.
Put Elena's loop steps in the right order:
Answer: Read player input โ Update game positions โ Draw the frame
The game loop repeats this sequence 60 times every second.
What happens if one frame takes 40 milliseconds instead of 16?
- The screen freezes or stutters.
- The game runs twice as fast.
Answer: The screen freezes or stutters.
Taking too long on a frame makes the game stutter.
Complete the facts about Elena's loop:
A smooth game draws ___ frames every second. Elena has only ___ milliseconds per frame.
Answer: A smooth game draws 60 frames every second. Elena has only 16 milliseconds per frame.
Each frame has 16 milliseconds to hit the 60 frames per second target.
What to remember
- Smooth games draw 60 frames per second.
- A game loop repeats continuously, even with no input.
- Each frame must finish in 16 milliseconds.
Next in this course: Talk to Hardware. It carries on in the Breni app.