Today you will use color-is-touching-color detection for precise collision 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 · CSTA 2-AP-17 · ISTE 1.5.c · Standards
| 🎯 I can | use color-is-touching-color detection for precise collision logic |
| 🧩 New blocks | 2 blocks |
| 📝 New words | 6 words |
| ⏱ Lesson time | ~40 min |
Teacher Guide
📋 Before class
⚠️ Common misconceptions
- Students often confuse touching color? with color is touching color?. The first checks if a sprite touches any pixel of a color. The second checks if a specific color ON the sprite touches a specific color elsewhere — much more precise.
- Students may try to use the color picker and select a color that looks correct but is slightly off. Guide them to click directly on the exact pixel they want.
- Students put clone behavior under
when flag clickedinstead ofwhen I start as a clone. The spawner script and the clone script are two separate scripts on the same sprite.
🎯 Differentiation
🐢 Struggling: Have students focus only on the feet-to-platform detection first. Skip coins until the basic platformer collision works.
🚀 Advanced: Challenge them to add a double-jump that only activates when the feet color is NOT touching the platform — detecting when the player is airborne.
💡 During the lesson
- Warm-UpAsk: "Why would it be a problem to use one sensor for everything?" Lead toward: a character might need to stand on a platform (feet) while also being near a wall (side). One sensor cannot tell these apart.
- Try ItShow students the Pico Walking costume and the feet you painted gold and the body you painted blue. Block 2 lets you say: "Is the yellow (feet) touching the brown (platform)?" The specificity is the key concept here.
The third experiment reinforces AND logic — the message fires only when both color pairs match. At height -60 the body touches the spike but the feet are in the air, so the AND is false. Ask what happens if you remove the gate entirely, so students see why the IF block is the gatekeeper. Scratch color detection is very strict, so encourage the eyedropper tool over typed hex. - PlanWalk through the flowchart before students open Scratch. Ask: "Why do we have three separate IF checks instead of one?" Answer: each check watches a different color interaction. One combined check would be impossible to write clearly. The Ball branches are review, not new material: clones came in L3 ch10 and L4 ch12, custom blocks in L4 ch6 and L4 ch13. Pico's existing red check needs no edit — a red clone is just more red on the stage.
- BuildThe color picker (eyedropper) is critical. Students who type hex codes manually will likely get slight mismatches. Require them to use the eyedropper on the actual drawn pixel. Also note: if the sprite shrinks, the costume pixel positions shift — color detection can break at very small sizes. Steps 11–12 are deliberate review of clones (L3 ch10, L4 ch12) and custom blocks (L4 ch6, L4 ch13) — the capstone in ch14 spawns bullet clones from a custom block, so this is the rehearsal for it. The teaching point here stays color detection: the moving red clone proves
<color is touching color?>reads sprites, not just painted backdrop shapes.
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.