Level 5

Space Patrol

Level 5 · Chapter 14

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 6–8

Plan a hard problem with a flowchart or pseudocode.

Code 2-AP-10Read the official text

Also practised: 2-AP-11 · 2-AP-12 · 2-AP-13 · 2-AP-17

Common Core State Standards for Mathematics

Expressions & Equations · Grade 6

Show how one amount changes with another.

Code 6.EE.C.9Read the official text

The short lines are our own words. We matched this lesson to these standards ourselves; the standards' owners have not reviewed or endorsed this course.

Common Core State Standards © 2010 National Governors Association Center for Best Practices and Council of Chief State School Officers. All rights reserved.

Today you will build a complete space shooter integrating all L5 skills.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-10 · CSTA 2-AP-11 · CSTA 2-AP-12 · CSTA 2-AP-13 · CSTA 2-AP-17 · ISTE 1.5.c · ISTE 1.4.d · Standards
🎯 I canbuild a complete space shooter integrating all L5 skills
📝 New words6 words
⏱ Lesson time~45 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students may put bullet clone behavior under 'when flag clicked' instead of 'when I start as a clone.' The bullet will only appear at the original position and never fire.
  • Students often make the bullet broadcast [hit] when it touches an enemy. Broadcast is global, so every enemy clone receives it and one bullet wipes the whole wave. Each enemy clone must check touching [Bullet ▾]? itself.
  • Students may set rotation style after movement code runs. Set rotation style first, before any forever loop, or the ship will rotate unexpectedly on the first frame.
  • Students expect pen color and pen size to recolor the stamped stars. Stamp copies the costume image, so only the pen down trail follows the pen color and pen size numbers.

🎯 Differentiation

🐢 Struggling: Build only the ship and one bullet first. Get firing working before adding enemies. A working core is better than a broken full game.

🚀 Advanced: Add a difficulty curve: every 10 points, increase enemy speed by 5% using a multiplier variable. Add a second enemy type with a different movement pattern.

💡 During the lesson

  • Warm-UpThis is a 45-minute lesson with significant open-ended building time. The first 10 minutes should be spent reading the flowchart and planning — resist the urge to let students start clicking immediately. Students who plan carefully will produce working games. Students who skip planning will have broken games that are hard to debug. Bringing every skill together into one working game is integration 🔗.
  • Try ItWalk through the Warm-Up sequence and the three bullet experiments as a class before building. Ask: "Which sprite owns the fire-bullet custom block — the ship or the bullet sprite?" (The ship calls it, but the clone is created for the Bullet sprite — so the custom block lives on the Ship.) Then ask: "Which sprite decides a bullet hit happened?" (The enemy clone — it checks touching [Bullet ▾] itself, so only the enemy actually touched responds.) This is a common confusion worth addressing early.
    These experiments develop game design intuition alongside programming skill. The bullet never broadcasts — it just rises and deletes when it leaves the screen or touches an enemy; the enemy clone is the side that detects the hit. After the third experiment, ask: "Why does a step of 200 make the bullet fly past an enemy without stopping?" With a big jump the bullet skips over the enemy between frames, so touching [Enemy ▾]? is never true at the moment they overlap. This is tunneling in collision detection — a real problem in professional game development. Discuss the fix: smaller movement increments so the bullet checks for contact more often.
  • PlanAllow 5 full minutes for flowchart tracing before any building. Ask each table: "Which sprite handles score?" (The enemy clone — it checks touching [Bullet ▾] inside its own movement loop and adds the points itself.) "Which sprite sends ship-hit?" (Enemy clone.) "Which script saves the high score?" (Ship, on receive game-over.) Resolving these decisions before coding prevents the most common capstone errors.
  • BuildCollision is detected on the enemy side, and that is the whole point of the Phase 3 clone script. Each enemy clone checks touching [Bullet ▾] inside its own movement loop, so only the enemy actually touched adds the score and deletes itself. The tempting alternative — having the bullet broadcast [hit] — is wrong: broadcast is global, so a single bullet would fire the handler on EVERY enemy clone at once, wiping the whole wave and inflating the score. That is exactly why we detect per-enemy with touching [Bullet ▾] instead of broadcasting. Broadcast stays only for ship-hit and game-over, where a single Rocketship sprite (not clones) receives it.