Week by week
Each week has a lesson plan, objectives, the questions to ask, the graded work and the vocabulary. The minutes are a guide.
Week 1
The game loop and input
Read the buttons, update the game, draw the result, and do it again, fast.
Learning objectives: students will be able to
- Describe a game loop as input, update and output
- Measure a reaction time with millis()
- Decide a winner fairly from two inputs
Lesson plan
- Warm up (5 min): play Reaction duel in pairs.
- Lesson (25 min): Project: a reaction timer.
- Explore (15 min): read the duel sketch. How does it decide who pressed first?
- Close (5 min): draw the game loop as three boxes.
Ask the class
- Why does a fair reaction game wait a random time before the light?
- What should happen if a player presses before the light comes on?
Graded work
- Project: a reaction timer: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Reaction duel · Reaction timer
Vocabulary
- Game loop
- Read input, update the game, draw it, and repeat.
- Input
- What the player does: a button, a knob, a stick.
- Latency
- The delay between an action and the response.
- Random
- Unpredictable, so the player cannot guess.
Standards: 2-AP-12, 3A-AP-16
Week 2
State and randomness
A die that tumbles and settles, and a program that always knows which state it is in.
Learning objectives: students will be able to
- Use random() and explain why a seed matters
- Write a program as named states with transitions
- Show a number on a seven-segment display
Lesson plan
- Warm up (5 min): roll Electronic dice twenty times and tally the results.
- Lesson (25 min): One variable that says where you are.
- Build (15 min): add a state to the dice: a "ready" pattern while waiting.
- Close (5 min): is your tally evenly spread? Why might it not be after only twenty rolls?
Ask the class
- Why would a die that starts from the same seed every time be a bad die?
- What are the states of the electronic dice, and what moves it between them?
Graded work
Projects to open: Electronic dice · OLED dice
Vocabulary
- State
- Which stage a program is in right now.
- Transition
- A rule that moves the program to another state.
- Seed
- The starting value for a sequence of random numbers.
- Seven-segment display
- Seven bars that light to show a digit.
Standards: 2-AP-11, 2-AP-12, 2-DA-08
Week 3
A memory game
Simon: a growing sequence stored in an array, played back and checked press by press.
Learning objectives: students will be able to
- Store a growing sequence in an array
- Compare player input against the stored sequence
- Give feedback with light and sound
Lesson plan
- Warm up (5 min): play Simon on the ring for two minutes.
- Lesson (30 min): Project: a memory game.
- Extend (10 min): change the speed as the sequence grows.
- Close (5 min): what is the longest sequence the array can hold?
Ask the class
- Why does the game keep the whole sequence instead of only the newest color?
- How could you make the game harder without changing the rules?
Graded work
- Project: a memory game: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: Ring Simon · ESP32-C3 Simon
Vocabulary
- Sequence
- An ordered list of steps.
- Index
- The position of an item in an array, counted from zero.
- Feedback
- What the game shows or plays in response to the player.
- Difficulty curve
- How a game gets harder as it goes.
Standards: 2-AP-12, 2-AP-13
Week 4
Drawing on a screen
Pixels, coordinates and frames on a 128 by 64 OLED over two wires.
Learning objectives: students will be able to
- Place shapes and text on a display using x and y coordinates
- Redraw a scene as frames
- Explain why a game repaints only what changed
Lesson plan
- Warm up (5 min): where is pixel (0, 0) on the screen?
- Lesson (25 min): A screen on two wires.
- Build (15 min): draw your initials and bounce a ball.
- Close (5 min): how many pixels does a 128 by 64 screen have?
Ask the class
- Why do games often redraw only the part of the screen that moved?
- Where is the origin on this display, and which way does y grow?
Graded work
- A screen on two wires: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: OLED on an ESP32-C3 · OLED on an Uno
Vocabulary
- Pixel
- One dot on a screen.
- Coordinates
- The x and y position of a pixel.
- Frame
- One complete drawing of the screen.
- Frame rate
- How many frames are drawn each second.
Standards: 3B-CS-02, 2-AP-16
Week 5
Pong: movement and collisions
A ball with a velocity, a paddle on a thumb stick, and the math of a bounce.
Learning objectives: students will be able to
- Move an object with a velocity each frame
- Detect a collision between a ball and a paddle
- Change the bounce angle based on where the ball hits
Lesson plan
- Warm up (5 min): play OLED pong. What decides the angle of a bounce?
- Lesson (25 min): Project: a console.
- Build (15 min): make the ball speed up after every fifth hit.
- Close (5 min): write the collision test in plain English.
Ask the class
- How does the game know the ball has hit the paddle?
- Why does the bounce angle depend on where the ball strikes the paddle?
Graded work
- Project: a console: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
Projects to open: OLED pong · Pong console · OLED pong on an ESP32-C3
Vocabulary
- Velocity
- How far an object moves each frame, and in which direction.
- Collision
- Two objects touching or overlapping.
- Bounding box
- The rectangle around an object, used to test collisions.
- Playtest
- Watching real players try a game to find what to fix.
Standards: 3A-AP-16, 2-AP-17
Week 6
Snake, and a game of your own
A snake that grows on two LED matrices, then a game each student designs, builds and playtests.
Learning objectives: students will be able to
- Represent a growing snake as a list of positions
- Design a game with clear rules, a goal and a way to lose
- Playtest with classmates and improve from their feedback
Lesson plan
- Warm up (5 min): play Snake on two matrices. How does it remember where the body is?
- Lesson (1 period): Project: the game is yours.
- Build (2 periods): design and build a game to a one-page brief: rules, controls, goal, how you lose.
- Playtest (1 period): swap links with another student, play, give one change, and make it.
Ask the class
- How does Snake know when the snake has bitten itself?
- What did your playtester find that you had not noticed?
Graded work
- Project: the game is yours: a lesson whose 6 steps tick against the running circuit. Assign it from your class page under A lesson.
- Rebuild Snake on two matrices and hand it in running. Assign Snake on two matrices as a template and add these checks. Our own build passes every one:
- Check: The game starts and says so (the serial monitor prints a line matching /snake on two MAX7219/ within 3 s).
Projects to open: Snake on two matrices · Snake · Stacker · Console
Vocabulary
- Game design
- Deciding the rules, goal and feel of a game.
- Win condition
- What a player must do to win.
- Iteration
- Changing a design after testing it, then testing again.
- Brief
- A short description of what a project must do.
Standards: 3A-AP-13, 2-AP-15, 2-AP-17