Block-Coding Game Design Studio: Four Mini-Game Projects

← Free Lesson Plans for Teachers

Free Lesson Plan

Grades 3–6Engineering & Coding4 sessions x 45 minHummingbird Bitmicro:bit1B-AP-091B-AP-101B-AP-152-AP-13

⬇ Download PDF (lesson, student sheets & answer key)

Driving question: How do game designers use events, loops, decisions, and variables to make a game fun and fair?

Overview

Students build four short games in a free block-coding editor: a catch game, a maze, a quiz, and a reaction-time game on a micro:bit. Each project adds one big idea: events (when a key is pressed), loops (forever), decisions (if touching a wall), and variables (score, lives, and timers).

Every session follows the same studio cycle: plan on paper, build, play-test with a partner, and fix one bug. Students keep a design journal so they can explain how each part of the program works and what they changed after testing.

Standards

CodeStandard
CSTA 1B-AP-09 (2017)storing and changing data with variables
CSTA 1B-AP-10 (2017)programs with events, loops, and decisions
CSTA 1B-AP-15 (2017)testing and fixing a program
CSTA 2-AP-13 (2017)breaking a program into parts

Grades 3–5: 1B codes. Grade 6: add 2-AP-13 by breaking each game into separate scripts or functions (movement, scoring, ending); see the Grade 6 steps in Sessions 1–3, the planning line on Student Sheet 1, and the Decomposition rubric row. CSTA codes are from the CSTA K-12 CS Standards (2017); the short labels are our own summaries, not CSTA wording. This lesson has not been reviewed or endorsed by CSTA.

Learning Objectives

Students will:

  • create programs that use events, loops, and if-then decisions.
  • use a variable to store and change a score, lives, or time.
  • test a program with a partner, find bugs, and fix them.
  • (Grade 6) break a program into smaller parts that each do one job.

Materials

Geyer resources for this lesson

Also needed

  • Computers or tablets with a free block editor: Scratch (scratch.mit.edu) for Projects 1–3, and Microsoft MakeCode for micro:bit (makecode.microbit.org) for Project 4
  • Micro-USB cables or 2×AAA battery packs for the micro:bits (neither is included with the single board). No micro:bits? Test Project 4 in the MakeCode simulator
  • Headphones (optional)
  • Student Sheets 1-3

Vocabulary

WordWhat it means
eventSomething that starts code running, such as a key press or a click.
loopCode that repeats.
conditionalAn if-then decision in code.
variableA named place that stores a value that can change, such as a score.
bugA mistake that makes a program act in a way you did not expect.
play-testLetting someone else try your game to find problems.

Safety Notes

  • Follow the school’s rules for online accounts; projects can be built offline or without sharing.
  • Use only the editor’s built-in sprites and sounds or your own drawings; do not upload photos of people.
  • Take a short stretch break between build and play-test.

Before You Teach

  • Check that the editors load on student devices; set up class accounts if your school uses them.
  • Copy Student Sheets 1-3 (Sheet 1 for each project).
  • Build Project 1 yourself first to show as a model.

Warm-Up (5 min)

  • Ask: "What makes a game fun? What makes it fair?" List answers (clear goal, a challenge, a score, rules that work every time).
  • Show the four projects on the board and the studio cycle: plan, build, test, fix.

Procedure

Session 1: Catch game (events and a score variable) (40 min)

  1. Plan on Student Sheet 1: the player moves a basket with the arrow keys; an apple falls from a random place at the top.
  2. Build: when the left or right arrow key is pressed, change x by 10 or −10 (events). Make the apple fall in a forever loop: change y by −5 each time.
  3. Grade 6: build movement, scoring, and resetting the apple as separate scripts (one script for each job).
  4. Make a variable called score. If the apple touches the basket, change score by 1 and send the apple back to the top.
  5. Play-test with a partner. Fix one bug and record it on Student Sheet 2.

Session 2: Maze game (decisions) (45 min)

  1. Draw a maze backdrop with one wall color.
  2. Use arrow keys to move the player. Add: if touching the wall color, go back to the start (conditional inside a forever loop).
  3. Add a goal: if touching the goal, say “You win!” and stop.
  4. Add a lives variable that starts at 3 and goes down by 1 each time the player hits a wall.
  5. Grade 6: build movement, the wall check, and winning or losing as separate scripts.
  6. Play-test and fix one bug.

Session 3: Quiz game (variables and if-else) (45 min)

  1. Plan five questions on a topic you know well.
  2. Use ask-and-wait blocks. If the answer is correct, change score by 1 and say “Correct!”; else say the right answer.
  3. At the end, show the score. Grade 6: put each question in its own script or block so it is easy to edit.
  4. Play-test with a partner: did every question score correctly? Fix one bug.

Session 4: micro:bit reaction game (45 min)

  1. In MakeCode, plan the game on Student Sheet 1: after a random wait, the screen shows an arrow; the first player to press their button wins.
  2. Build: on start, set a variable go to 0, then pause a random time (1–5 seconds). If go is still 0, set go to 1, then show the arrow. On button A or B: if go = 1, set go to 2, then show A or B as the winner; else if go = 0, set go to 2, then show an X (pressed too early). If go = 2, do nothing, so the winner stays on the screen. Press the reset button to play again.
  3. Download to the micro:bit and test. Fix one bug.
  4. Studio share: each pair demonstrates one game and explains one variable and one bug fix. Complete Student Sheet 3.

Differentiation

SupportOn-levelChallenge
• Provide starter projects with the movement code already built.
• Use the block cards on Student Sheet 1 as a checklist.
• Complete the procedure and student sheets as written.• Add a timer variable that counts down from 30 and ends the game at 0.
• Grade 6: make a custom block (function) for “reset player” and use it in two places.

Assessment

  • Check plans before students start building.
  • Read bug logs: is the bug described, and is the fix explained?

Exit ticket: Ask: "Point to one variable in your game. When does it change, and why?"

CriterionBeginningDevelopingProficient
Events and loopsMissingUsed with helpUsed correctly in each project
Variables and decisionsMissingUsed, some errorsScore, lives, or timer works with if-then logic
Testing and debuggingNo testingTested, no fix recordedBug found, described, fixed, and retested
Decomposition (Grade 6)One long scriptSome parts separatedEach part in its own script or custom block

Extensions

  • Use the Hummingbird kit to add a light that flashes when the player scores.
  • Design a game for a younger class and play-test it with them.

Student Sheets

Use these sheets in class, or download the PDF for a print-ready layout.

Student Sheet 1

Game Plan

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

Game name and goal:

Grade 6: List the parts of this game (movement, scoring, ending) and which script does each:

Sprite or partWhat it doesEvent that starts it
Variable nameStarts atChanges when…
Sketch the game screen.
  • □ I used an event.
  • □ I used a loop.
  • □ I used an if-then decision.
  • □ I used a variable.

Student Sheet 2

Play-Test and Bug Log

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

ProjectWhat went wrong (the bug)What we changedFixed? (yes/no)

Partner feedback: one thing that was fun and one thing to improve:

Student Sheet 3

Studio Reflection

Print-ready version in the PDF.

Name: ______________________________   Date: ______________

Which project was hardest? Why?

Explain how one variable works in your favorite game:

Grade 6: How did you break one program into smaller parts?

Show answer key (for teachers)

Answer Key & Teacher Notes

Sample Scripts (in plain words)

  • Catch: when green flag clicked, then set score to 0, then go to a random x at the top, then forever: change y by −5; if touching basket, then change score by 1, then go to a random x at the top; if y < −170, then go to a random x at the top.
  • Maze: when green flag clicked, then set lives to 3, then go to start, then forever: if touching wall color, then change lives by −1, then go to start; if lives = 0, then say “Game over”, then stop all; if touching goal, then say “You win!”, then stop all.
  • Quiz: set score to 0, then ask question, then if answer = correct answer then change score by 1, say “Correct!” else say the right answer, then (repeat for each question), then say “You scored” joined with score.
  • micro:bit: on start, then set go to 0, then pause random 1000–5000 ms, then if go = 0, then set go to 1, then show the arrow. On button A pressed, then if go = 1, then set go to 2, then show “A”; else if go = 0, then set go to 2, then show X. Same for button B. Set the new value of go before any show block, because a show block pauses while the display plays and the other button’s code can still run. Because go becomes 2 before the letter appears, a near-tie cannot replace the winner. (With a simple true/false go, an “else show X” would overwrite the winner on the second press.)

Common Bugs

  • Score goes up many times per catch: send the apple back to the top right after scoring.
  • Player walks through walls: the wall check must be inside the forever loop.
  • Quiz marks a right answer wrong: check spelling and extra spaces (Scratch’s = block ignores capital letters), or accept two spellings.
  • Reaction game: a player can win by pressing early, or the second press overwrites the winner; set go to 2 before showing A, B, or X so only the first press counts.

Need a print-ready copy? The PDF includes the lesson, student sheets, and answer key.

Download the PDF  |  All free lesson plans

Free for classroom use. You may print and copy this lesson for your students. © Geyer Instructional Products. Standards text: CSTA K-12 CS Standards © CSTA. Scratch is a project of the Scratch Foundation, available free at https://scratch.mit.edu. Microsoft MakeCode is a Microsoft product; micro:bit is a trademark of the Micro:bit Educational Foundation. This lesson is not affiliated with or endorsed by the Scratch Foundation, Microsoft, or the Micro:bit Educational Foundation.