Today you will read the current backdrop name or number to drive scene-based logic.
1 Warm-Up
2 Predict
3 Try It
4 Plan
5 Build
6 Fix It
7 Extend
8 Math Challenge
For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 2
✦ CSTA 2-AP-12 · ISTE 1.5.c · Standards
| 🎯 I can | read the current backdrop name or number to drive scene-based logic |
| 🧩 New blocks | 1 block |
| 📝 New words | 6 words |
| ⏱ Lesson time | ~40 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students expect backdrop name to return a number, or backdrop number to return a name. The dropdown selects which property is returned.
- Students use backdrop number for comparisons but name is more readable and less error-prone when backdrops are reordered.
- Students think event_whenbackdropswitchesto and checking backdrop name inside a loop are equivalent — they have different timing. The event fires once at the moment of switch; the loop checks every frame.
🎯 Differentiation
🐢 Struggling: Build only 2 scenes (menu + game). Show how backdrop name changes the say message. Add the third scene as an extension.
🚀 Advanced: Challenge them to remove the state variable entirely — use only backdrop name for all branching. Can every if condition be replaced by a backdrop name check?
💡 During the lesson
- Warm-UpAsk: "In your favorite game, how many different 'screens' does it have?" (Title screen, level select, gameplay, pause menu, game over, credits.) This makes the concept concrete before touching code. The key insight: every screen has a name, and the game's code reads that name to decide what to do.
- Try ItShow the backdrop list in Scratch. Click each backdrop and point out its name in the name field at the top. Rename "backdrop1" to "menu", "backdrop2" to "game", "backdrop3" to "gameover". Emphasize: the name in that field is exactly what
backdrop [name ▾]returns. Spelling must match — a typo or a stray space breaks the check. Capital letters do not: Scratch's=ignores them.
The backdrop number is the critical case: inserting a backdrop before "game" changes its number from 2 to 3, silently breaking the condition. Name comparison is more robust. This is a real software maintenance lesson — "magic numbers" in code are fragile; named constants (or in this case, named backdrops) are safer. - PlanThe flowchart shows a complete state machine. Every arrow is a transition triggered by a condition. This is the same pattern used in professional game engines — Unity calls this a "State Machine" component. The flowchart habit at L5 prepares students to read and write formal state diagrams at L6.
- BuildStep 10 deliberately introduces a bug for students to find and fix. This is an important hands-on lesson about string matching precision. Ask two questions and let the board answer: "If the backdrop is named
Gamebut the condition checksgame, what happens?" — it still matches, because Scratch's=ignores capital letters. "And if the backdrop is namedgam?" — now the condition is false and Pico's script never runs in the game scene. The lesson is *which* differences matter.
Show the picture first. Ask what will happen — everyone points or says one word.
Everyone picks an answer first. Then press the flag together.
Change one thing at a time. Run it, watch, then change the next thing.
Pairs put the cards in order before anyone opens Scratch.
Students build step by step. Walk around — help with questions, not with the mouse.
Ask: what did we want, and what did it do? Let them find it.
Fast finishers pick the next tier. Everyone else finishes their build.
Work it out on paper first. Then check it on the stage.