Today you will define reusable code with a custom block (no parameters).
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-14 · ISTE 1.5.c · Standards
| 🎯 I can | define reusable code with a custom block (no parameters) |
| 🧩 New blocks | 2 blocks |
| 📝 New words | 6 words |
| ⏱ Lesson time | ~35 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students think the define block runs automatically. It does not. The define block only stores the instructions. You must call the custom block to run them.
- Students put the define block inside another script. The define block must stand alone with its body — it is not placed inside a forever or when flag clicked.
🎯 Differentiation
🐢 Struggling: Use a physical analogy: a recipe card (define) vs. cooking (calling). Write the recipe, then follow it. Show the define block alone, then the call block in the main script.
🚀 Advanced: Define a second custom block called walk-triangle. Call both walk-square and walk-triangle from the main script so the cat walks two different paths.
💡 During the lesson
- Warm-UpAsk: "If a video game character has a jump animation with 6 steps, and the character can jump 50 times in a game — how many times would you write those 6 steps without custom blocks?" (300 times.) Custom blocks reduce this to 6 + 50 calls. A custom block is a procedure 📜 — a named set of steps you can run anytime.
- Try ItProject the second experiment. Count the blocks: without a custom block, 3 × 3 = 9 blocks for the body. With it, 4 (define) + 3 (calls) = 7 blocks. Ask: "Which is easier to fix if you want the side length to change?" (The custom block — edit once, all 3 calls update.) The Xy-grid backdrop lets students trace the cat's square path with a finger.
The first experiment with 0 calls is the most important. Students see the define block exists, but nothing happens — proving that define alone does not run. The call is required. Ask: "What is missing with 0 calls?" (The call.) - PlanThe flowchart separates the define (written once, shown as its own lane) from the main flow (4 calls). Students should see that the define is not inside the main flow — it is a separate definition that the main flow uses by name.
- BuildStep 10 is the key payoff demonstration. Students who change the move value in the define once and see the whole four-lap walk resize on the next run experience the power of the abstraction — one edit, every call changes. This moment builds deep understanding of why custom blocks exist.
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.