Coding · Grade 9
Game Loops, State and Input
Learners trace the input-update-render game loop frame by frame, make movement fair on every device with delta time and a fixed-timestep accumulator, organise menus, play, pause and game over as a state machine that controls which systems run, and derive pressed, held and released events from raw input, with buffering and remappable controls.
- 4 lessons
- About 95 minutes
- Check what you learned: 8 questions
- Ways to answer: choose an answer, trace code, match pairs, type a number, put in order and sort into groups
What learners will discover
- Explain and trace the game loop's input, update and render steps across frames.
- Use delta time and fixed timesteps so gameplay is the same at any frame rate.
- Manage game modes with a state machine and decide which systems run in each state.
- Derive pressed, held and released input events and apply buffering and remapping.
Lessons
-
The game loop 5 steps2 practiceabout 20 min
-
Time and frame rate 5 steps3 practiceabout 24 min
-
Game states 4 steps3 practiceabout 20 min
-
Reading input well 4 steps3 practiceabout 20 min
-
Check what you learned 8 questions at the end
Keep exploring
More 9th grade coding
- 9th Grade Coding Worksheets10 printable worksheets
Guide for grown-ups
- How to start homeschooling: a step-by-step guide for familiesA guide for parents · 7 min read