Today you will read a sprite's live state with position and direction reporters, and read the keyboard with a key-pressed Boolean.
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 · CSTA 2-AP-17 · ISTE 1.5.c · Standards
| 🎯 I can | read a sprite's live state with position and direction reporters, and read the keyboard with a key-pressed Boolean |
| 🧩 New blocks | 4 blocks |
| 📝 New words | 8 words |
| ⏱ Lesson time | ~40 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students often try to use (x position) as a command block — it is a reporter, not a stack block. It cannot stand alone in a script.
- Students may think x position updates only when the sprite moves. Clarify: it is always current — the value at any moment the block is evaluated.
- Students often confuse the hat block when [right arrow ▾] key pressed (Level 1 Ch6) with the Boolean reporter
introduced here. The hat block starts its own script once when the key goes down; the Boolean reports true or false and cannot start anything — it must be plugged into an if, which is why it is re-checked every pass of the forever loop.
🎯 Differentiation
🐢 Struggling: Show the Stage coordinate grid with labeled axes. Have students physically place Pico at x:0 y:0 (center), x:240 y:0 (right edge), x:-240 y:0 (left edge) before writing any code.
🚀 Advanced: Challenge students to save two spots with the same y and make Pico say how far apart they are, using x position and the subtract block — then test it with one spot left of the center and one right of it.
💡 During the lesson
- Warm-UpDisplay the Scratch stage with its coordinate overlay (View → Show). Ask: "Where is the center? Where is the right edge? What is the y value at the very top?" This grounds the abstract numbers before any coding.
- Try ItContrast the rounded reporter shape with the rectangular command block shape. Ask: "Can you place (x position) alone in a script — as the first block?" No — it has no notch. It must plug into something that expects a number.
In the first experiment, pick direction: Pico says -90 because it faces left — 90 is right. The third experiment makes the difference between a live reporter and a stale variable visible — y_saved stops following Pico because nothing writes to it inside the loop. - PlanAsk students to trace through the flowchart before building. Where does x_saved get its first value? (Set to 0 at start.) What happens if 'r' is pressed before space? (Glides to 0, 0 — the initial value.)
- BuildStep 6 introduces the key pattern: reporters used as the *source* in a set block. Step 8 uses saved variables as coordinates in glide — a direct application of storing and replaying position data.
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.