Level 3

Mouse X and Y

Level 3 · Chapter 7

What this lesson follows

CSTA K–12 Computer Science Standards (2017)

Algorithms & Programming · Grades 3–5

Use events, loops and if-then in one program.

Code 1B-AP-10Read the official text

Also practised: 1B-AP-15

Common Core State Standards for Mathematics

Geometry · Grade 4

Draw lines and angles and sort shapes by them.

Code 4.G.A.1Read 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 read the mouse position and use it to move sprites.

1👋 Warm-Up

For teachers · goals · guide
Lesson Outcomes · for teachersCSTA 1B
✦ CSTA 1B-AP-10 · CSTA 1B-AP-15 · ISTE 1.5.a · Standards
🎯 I canread the mouse position and use it to move sprites
🧩 New blocks2 blocks
📝 New words5 words
⏱ Lesson time~40 min
Teacher Guide

📋 Before class

⚠️ Common misconceptions

  • Students may put mouse x in the y box and mouse y in the x box — the cat then follows in a mirrored, diagonal way. Check the boxes.
  • Students may confuse this with go to [mouse-pointer ▾] — that is one block; using mouse x and mouse y separately gives more control.

🎯 Differentiation

🐢 Struggling: Draw two axes on paper. Mark an X point and a Y point. Ask: 'If the mouse moves right, which number changes?' (X.) Physically move a finger across the page.

🚀 Advanced: Put (mouse x) in the x box but a fixed number in the y box of go to x: () y: () — cat tracks left/right but stays at one height. Perfect for a paddle. Ask: which axis should a paddle follow?

💡 During the lesson

  • Warm-UpMove the mouse slowly around a projected Scratch stage running forever + say (join (mouse x) (join [, ] (mouse y))) so the numbers show live. Students call out "Up!" "Left!" "Down!" as you move. Ask: "Which number changes when I move left?" (X.) "Which when I move up?" (Y.) Left-and-right movement is horizontal 🌅; up-and-down is vertical.
    Emphasize that the cat jumps with no slow moving — it is there right away. Ask: "Is this different from point towards mouse + move?" (Yes — that one is slow; this jumps right away.) Students will see the difference in Fix It.
  • Try ItShow (mouse x) and (mouse y) from the 🔵 Sensing group. Click each to see its number; move the mouse and click again to see it change. mouse x changes left-right; mouse y changes up-down. Drop them into the boxes of go to x: () y: () (from earlier) to make the cat jump to the cursor.
    Let students try the experiments on their own Scratch stage. Ask them to describe in ONE word what each version does. Vocabulary to reinforce: "both axes" vs. "one axis." For the paddle game connection: "A paddle only needs to follow left/right — which experiment puts the cat at the bottom and follows left/right?" (Experiment 1 with y at -130.)
    In the block box and the Plan, the mouse waits in the middle of the stage. So «under the mouse» is x = 0 and «level with the mouse» is y = 0. Ask: "Which hole holds the mouse, and which holds a number?"
  • PlanAsk: "Why is this inside a forever loop?" (So it updates every frame — if it ran once, the cat would only go to one position and stop.) Students who forget the forever loop will see exactly that behavior in Build.
  • BuildAfter step 4, ask students to move the mouse to each corner of the stage. The cat should follow right away. Common issue: students put mouse x in the y box and mouse y in the x box — cat follows diagonally in a mirrored way. Let them discover and correct it.