Learning Goals 3 min
By the end of this lesson you will be able to:
- Recall the four key headings:
0up,90right,180down,-90left. - Use
point in direction (90)to set a heading exactly, from inside a script. - Explain why
point in direction (90)andturn cw (15) degreesare not the same thing.
Warm-Up 7 min
Your cat glides beautifully — but always sideways, whichever way it happens to be facing. And the only way to change its heading so far has been to nudge it with turn blocks, or type into Sprite Properties by hand.
Quick-fire puzzle
Priya set her cat’s Direction to 0 in Sprite Properties, then clicked the flag. Which way did it move?
when flag clicked
move (100) steps
Reveal the answer
The cat moved 100 steps straight up. A move block has never meant “go right”. It means “go forward”, and forward is whatever the Direction box says.
Today you get a block that sets that box from inside the script, so you no longer have to remember to type it in first.
New Concept — setting a heading 15 min
Picture the cat holding a compass. Everything it does travels along whichever way that needle points. point in direction (90) takes hold of the needle and puts it exactly where you say — no movement, just a new forward.
Blocks reference
| Block | Category | What it does |
|---|---|---|
point in direction (90) | Motion | Sets the heading to exactly that number of degrees. Rotates the sprite, never moves it. |
turn cw (15) degrees | Motion | From Lesson 8. Adds to the current heading rather than replacing it. |
The same idea you met in Lesson 10
You have seen this pattern before. A move block adds to where you are; a go-to block replaces it. Headings work the same way — a turn block adds degrees, and point-in-direction replaces them.
That matters because adding depends on where you started. Turn 90 degrees twice and you have gone 180, which may be somewhere you did not want. Point in direction 90 lands on 90 every single time, no matter what came before.
The direction dial
Point first, then travel
when flag clicked
go to x: (0) y: (0)
point in direction (0)
move (100) steps
Notice the order. Setting the heading after the move would be far too late — the cat would already have gone the old way.
Why it matters
Without this block, a sprite’s heading depends on whatever happened earlier in the project, which makes scripts unpredictable. With it, every run starts from a known heading — exactly the same reason you begin scripts with a go-to block.
Worked Example — Aiman the four-way cat 15 min
We give the cat a known heading, send it that way, then change the heading and watch the very same move block do something completely different.
Step 1 — Hat and reset
Drag in when flag clicked, then go to x: (0) y: (0). Every run now begins from the centre.
Step 2 — Set the heading
From Motion, snap on point in direction (90) and change the number to 0. The cat rotates to face up. Nothing else happens — check the x and y boxes and you will see they have not moved.
Step 3 — Travel
Add move (10) steps and change it to 80.
when flag clicked
go to x: (0) y: (0)
point in direction (0)
move (80) steps
Step 4 — Click the flag
The cat snaps to the middle, spins upward, then jumps 80 pixels toward the top of the garden. Check the boxes: x is still 0, y is now 80.
Step 5 — Change one number
Edit the point block to -90 and run it again. The move block is untouched, yet the cat now travels left and finishes at (−80, 0). One number changed the entire journey.
Step 6 — Try a diagonal
Set the point block to 45. Now the cat heads up and to the right at the same time, ending somewhere near (57, 57). Directions are not limited to the four you can name.
Step 7 — Swap the move for a glide
Replace the move block with glide (2) secs to x: (-80) y: (0) and set the point block back to -90. Now the cat faces left and travels left, smoothly. That combination — point first, then glide — is what makes a sprite look like it means it.
What changed: your cat no longer inherits a heading from whatever happened last. Every run sets its own, so the script behaves the same way every time.
The full assembled stack (your reference)
when flag clicked
go to x: (0) y: (0)
point in direction (-90)
glide (2) secs to x: (-80) y: (0)
Try It Yourself — three small builds 12 min
Goal: Send the cat downward. Set the heading to face down, then step 60.
when flag clicked
go to x: (0) y: (0)
point in direction (180)
move (60) steps
Think: the y box goes down, not up, because 180 points toward the bottom of the Stage. The x box never changes at all.
Goal: Walk an L-shape using headings instead of turns. Right first, then down — and set each heading exactly rather than nudging it.
when flag clicked
go to x: (-100) y: (100)
point in direction (90)
move (80) steps
point in direction (180)
move (80) steps
Think: in Lesson 8 you built this with a turn block, and you had to work out what 90 degrees clockwise from the current heading would give. Here you just name the heading you want. Which felt safer?
Mini-mission: uphill to the butterfly. The butterfly is up and to the right of the cat. Send the cat climbing diagonally to meet it, and have it announce the climb when it arrives.
It works if: the cat travels in one straight diagonal line rather than a right-then-up staircase, it finishes near the butterfly, and it speaks when it gets there. Stay within 8 blocks.
Think: which number sits exactly halfway between “up” and “right” on the dial? Once you have that, the move block does the rest by itself.
Mini-Challenge — two corners, one click 5 min
“Aisyah’s cat changes its mind”
Send the cat from the centre of the garden out to one corner, then have it change heading and set off for a different corner — all on a single flag click, and always facing the way it travels.
It works if:
- One flag click runs the whole journey.
- The cat sets its heading before each leg, not after.
- It ends in a corner it did not start next to.
- A watcher can follow both legs — neither is over in a flash.
Reveal one valid solution (teacher)
when flag clicked
go to x: (0) y: (0)
point in direction (90)
glide (1) secs to x: (200) y: (0)
point in direction (180)
glide (1) secs to x: (200) y: (-150)
Six blocks. Worth discussing: the point blocks make no difference to where the glides go — they only make the cat face the right way. Pupils who delete them will see the journey still work but look wrong, which is the whole lesson.
Recap 2 min
The point-in-direction block sets a sprite’s heading exactly: 0 up, 90 right, 180 down, -90 left, and every number in between. It rotates without moving, so a move or a glide has to follow. And unlike a turn block, which adds degrees to whatever you already had, this one replaces them — which is what makes a script behave the same way every run.
- Direction (heading)
- The compass number a sprite faces. 0 up, 90 right, 180 down, −90 left.
- point in direction (block)
- The Motion block that sets a heading exactly. Rotates the sprite without moving it.
- Set versus add
- Point-in-direction replaces the heading; a turn block adds to it — the same difference as go-to versus move.
- Forward
- Whichever way the sprite currently faces. Every move block follows it.
Homework 1 min
The four-way salute. Face the cat up, glide up, then face it right and glide right — a small L-shaped salute with correct facing throughout.
- Build the six-block stack below.
- Click the flag and watch the cat face up, glide up, face right, glide right.
- Check the boxes afterwards: x should read
60, y should read60. - Screenshot your Script Area.
when flag clicked
go to x: (0) y: (0)
point in direction (0)
glide (1) secs to x: (0) y: (60)
point in direction (90)
glide (1) secs to x: (60) y: (60)
Bring back next class:
- A screenshot of your six-block Script Area.
- Your answer to: “If you set the heading to 45 and then move 100 steps, does the cat end up above, to the right, or somewhere in between — and why?”
Heads up for next class: SCR-L01-13 teaches the one block that stops a sprite getting stuck against the edge of the garden: if on edge, bounce.