Learning Goals 3 min
By the end of this lesson you will be able to:
- Use a go to x: (0) y: (0) block to teleport the cat to any spot on the Stage.
- Explain the difference between moving (sliding from where you are) and going to (jumping straight to a named spot).
- Build a script that visits two corners — top-left then bottom-right — with one click of the green flag.
Warm-Up 7 min
Last lesson you learned the map. Today you get the teleport block — a single Motion block that picks the cat up and drops it at any spot you name.
Quick-fire puzzle
Daniel built this stack. The cat started at x = 0, y = 0. Where does it end up after the green flag is clicked?
when flag clicked
go to x: (100) y: (50)
Reveal the answer
The cat lands at x = 100, y = 50 — a bit to the right of centre, a bit above. The block doesn't care where the cat was before. It picks the cat up and drops it at the named spot. Teleport, not walk.
Try it. Drag the cat anywhere on the Stage first. Then click the flag. The cat snaps to (100, 50) no matter where it started.
New Concept — teleporting vs walking 15 min
Imagine you are at the swing in a playground in Kuala Lumpur. Two ways to get to the slide:
- Walk over. Step by step from where you are. That's what move (10) steps does.
- Teleport. Close your eyes and *poof* — you're at the slide. That's what go to x: (0) y: (0) does.
The new block
| Block | Category | What it does |
|---|---|---|
| go to x: (0) y: (0) | Motion | Jumps the sprite straight to the named (x, y) spot — no sliding, no in-between steps. |
Two number slots
The go-to block has two white circles, not one. The first slot is the x. The second slot is the y. Click each slot to type a number — positive, negative, or zero.
- go to x: (0) y: (0) — jump to the centre.
- go to x: (-200) y: (150) — jump to the top-left.
- go to x: (200) y: (-150) — jump to the bottom-right.
- go to x: (0) y: (180) — jump to the top edge, middle width.
Move vs Go to — side by side
| Block | How it changes x and y | Cares about direction? |
|---|---|---|
| move (50) steps | Adds to your current x and y (depends on direction). | Yes — moves "forward". |
| go to x: (0) y: (0) | Replaces your current x and y with the numbers in the slots. | No — direction doesn't matter. |
Why it matters
Most games reset their characters with a go-to block. The player dies? go to x: (-200) y: (0) — back to the start. The cat needs to begin every round at the same spot? Start the script with a go-to. It's the easiest "reset button" in Scratch.
Worked Example — corner to corner with Mei Ling's Cat 15 min
We'll build a script that jumps the cat to the top-left, then to the bottom-right. Open Scratch in a new tab.
Step 1 — Reset
Click the cat in the Sprite list. In Sprite Properties, type x = 0, y = 0, Direction = 90. Cat sits dead centre.
Step 2 — Build the first jump
Drag when ⚑ clicked from Events. Drag go to x: (0) y: (0) from Motion. Snap them together.
The block defaults to 0 and 0. Click the first slot (the x) and type -200. Click the second slot (the y) and type 150.
when flag clicked
go to x: (-200) y: (150)
Click the green flag. The cat blinks to the top-left of the Stage. Check Sprite Properties: x = -200, y = 150.
Step 3 — Add the second jump
Drag another go to x: (0) y: (0) block from Motion. Snap it under the first one. Set its x slot to 200 and its y slot to -150.
when flag clicked
go to x: (-200) y: (150)
go to x: (200) y: (-150)
Step 4 — Click the flag
The cat appears to end up at the bottom-right. But wait — it should also have been at the top-left for a moment! Where did that step go?
Scratch ran the two blocks so fast that the first jump was over before your eyes could see it. The cat was at the top-left for a tiny fraction of a second, then snapped to the bottom-right.
Step 5 — Slow it down with what you've already met
You can use say [Hello!] for (2) seconds from SCR-L01-01 between the two jumps. The "for 2 seconds" part holds the script for 2 seconds — long enough for you to see the cat at the top-left before it leaves.
when flag clicked
go to x: (-200) y: (150)
say [I am here!] for (2) seconds
go to x: (200) y: (-150)
say [Now over here!] for (2) seconds
Step 6 — Click the green flag
Now the cat jumps to top-left, says "I am here!" for 2 seconds, jumps to bottom-right, says "Now over here!" for 2 seconds. You can finally see the journey.
What changed: compared to a long stack of move blocks, two go-to blocks place the cat anywhere in two clicks of effort. No counting steps. No worrying about direction. Just name the spot, jump there.
Try It Yourself — three small builds 12 min
Goal: Send the cat to the top edge, middle width. Build this stack and click the flag.
when flag clicked
go to x: (0) y: (180)
Think: x = 0 (middle), y = 180 (top edge). The cat jumps straight up to the top of the Stage. Check Sprite Properties to confirm.
Goal: Reset the cat. Drag the cat anywhere on the Stage with your mouse — top corner, left edge, wherever. Then click the flag. The cat must snap back to the centre.
when flag clicked
go to x: (0) y: (0)
Think: No matter where the cat starts, the go-to block teleports it to (0, 0). This is the "home" pattern you'll use in every game.
Goal: Visit three spots in order. The cat starts at the centre. Send it to the top-right, then the bottom-left, then back home. Use a say block between each jump so you can see each stop.
when flag clicked
go to x: (200) y: (150)
say [Top-right] for (1) seconds
go to x: (-200) y: (-150)
say [Bottom-left] for (1) seconds
go to x: (0) y: (0)
say [Home!] for (1) seconds
Think: Seven blocks, just under the Level 1 cap. The cat visits three spots, with a one-second pause at each. Combines today's go-to with the say block from SCR-L01-01.
Mini-Challenge — match the move 5 min
"Same result, different blocks"
Without using the move block, get the cat to the spot it would have ended up at after this old script:
when flag clicked
move (150) steps
Assume the cat started at x = 0, y = 0, Direction = 90. Build a new script (one click of the flag) that uses a go to x: (0) y: (0) block to land the cat at the exact same spot.
It works if:
- Your new script has one go-to block, no move blocks.
- Clicking the flag once lands the cat at the same final x and y as the old script.
- You can explain to a friend why the two scripts give the same end position.
Reveal one valid solution
The old script moved 150 steps right from (0, 0). That lands at (150, 0). The new script just names that spot directly.
when flag clicked
go to x: (150) y: (0)
Same end. Different journey. The move block added 150 to the x; the go-to block set x to 150 directly. This combines today's go-to block with the coordinate map from SCR-L01-09 — the link between "many steps" and "one named spot".
Recap 2 min
The go-to block teleports the cat to any (x, y) spot in one snap. It has two number slots — x first, y second. It doesn't care about Direction or where the cat was before. It just sets x and y to the values you typed. Move blocks add; go-to blocks set. Both are useful — pick the one that matches the job.
- Teleport
- Jumping straight to a spot with no in-between steps. The go to x: y: block does this.
- Go to (block)
- The Motion block go to x: (0) y: (0) — sets the sprite's x and y to the numbers in the two slots.
- Set vs add
- Go-to sets the new x and y (replaces). Move adds to the current x and y (changes by an amount).
- Reset
- Putting a sprite back to a known starting spot. Most projects start with a go-to as a reset.
Homework 1 min
The four-stop teleport tour. Build a script that visits four spots on the Stage in order, with a 1-second say between each. Use only blocks taught so far — when ⚑ clicked, go to x: y:, and say [...] for (N) seconds.
- Open Scratch (web or desktop). Click the cat.
- Reset Sprite Properties: x =
0, y =0, Direction =90. - Build this stack (or change the spots to your own four favourites):
- Stop 1: go to x: (-200) y: (0) — left edge.
- Stop 2: go to x: (0) y: (150) — top edge.
- Stop 3: go to x: (200) y: (0) — right edge.
- Stop 4: go to x: (0) y: (-150) — bottom edge.
- Put a say [Stop 1] for (1) seconds (changing the number for each stop) after each jump.
- Click the green flag once. The cat should visit all four edges with a brief pause at each.
- Take a screenshot of your Script Area.
Bring back next class:
- The screenshot of your Script Area.
- Your written answer to: "Could you do this same homework using only move and turn blocks? Would that be easier or harder than using go-to blocks? Why?"
Heads up for next class: SCR-L01-11 introduces a third Motion block — glide (1) secs to x: (0) y: (0). The cat will slide smoothly to a spot instead of teleporting.