Learning Goals 3 min
By the end of this lesson you will be able to:
- Use
change size by (10)andset size to (100) %. - Say which of the two you need for a given job, and why.
- Build a size change that always returns a sprite to normal, however many times it runs.
Warm-Up 7 min
Your characters can talk, think and walk. But they are all exactly the same size all the time, and size is one of the easiest ways to show surprise, distance or importance.
Quick-fire puzzle
Aisyah clicked the flag five times in a row. The cat started at its normal size. How big was it by the end?
when flag clicked
change size by (25)
Reveal the answer
It reached 225% — more than twice its normal size — because each click added another 25 on top of whatever it already was.
This is exactly the trap you met with move blocks back in Lesson 10. Adding depends on where you started; replacing does not.
New Concept — add or replace, again 15 min
You have met this pattern twice already. Move adds to a position, go-to replaces it. Turn adds to a heading, point-in-direction replaces it. Size works the same way, and once you see that, there is very little new to learn.
Blocks reference
| Block | Category | What it does |
|---|---|---|
change size by (10) | Looks | Adds to the current size. Depends on what the size already was. |
set size to (100) % | Looks | Replaces the size with that number, whatever it was before. |
Size is a percentage
The number is not pixels — it is a percentage of the sprite’s natural size. 100 is normal, 50 is half, 200 is double. That means the same numbers work sensibly on a tiny sprite and a huge one.
Why runaway growth happens
A change block inside a loop grows a sprite forever, because each pass adds to a size that is already bigger. Ten passes of change size by (10) leaves a sprite at 200%, and running the script twice leaves it at 300%.
The fix is always the same: a set size to (100) % at the top of the script, so every run starts from the same place.
Why it matters
Size is a shortcut to feeling. A character that swells is excited or angry; one that shrinks is frightened or far away. It is the loudest visual tool you have, which also means it is the easiest to overuse.
Worked Example — a cat that reacts 15 min
We build a startled jump: the cat swells in surprise, then settles back to normal. The settling is the part everyone forgets.
Step 1 — Make it grow
Build a single change block and click the flag several times. The cat grows and grows, and never comes back.
when flag clicked
change size by (60)
Step 2 — Fix the start
Add a set-size above it so every run begins from normal, however the last one ended.
when flag clicked
set size to (100) %
change size by (60)
Step 3 — Make it a reaction, not a state
A startle is temporary. Add a pause and a return so the cat settles back down.
when flag clicked
set size to (100) %
say [Oh!] for (1) seconds
change size by (60)
wait (0.5) seconds
set size to (100) %
Step 4 — Run it repeatedly
Click the flag five times in a row. The reaction is identical every time, because both ends of it are pinned by set-size blocks.
Step 5 — Try it with change blocks only
Replace the final set-size with change size by (-60) and run it several times. It looks fine — until you interrupt a run with the stop sign partway through, and the cat is left permanently oversized.
That is the argument for set-size at the end. Add-and-subtract only balances if nothing interrupts it, and something always interrupts it eventually.
Step 6 — Use size for distance instead
Try a different job for the same blocks: shrink the cat as it walks away, so it appears to be receding.
when flag clicked
set size to (100) %
repeat (8)
move (30) steps
change size by (-8)
wait (0.1) seconds
end
What changed: your characters can now react physically, and you know which of the two blocks to reach for without guessing.
The full assembled stack (your reference)
when flag clicked
set size to (100) %
say [Oh!] for (1) seconds
change size by (60)
wait (0.5) seconds
set size to (100) %
Try It Yourself — three small builds 12 min
Goal: Make the cat shrink to half its size and stay there, however many times you click.
when flag clicked
set size to (50) %
Think: two blocks, and clicking ten times gives the same result as clicking once. Try the change version instead and watch the cat vanish into a dot.
Goal: Give the cat a heartbeat — a gentle pulse that returns to exactly the size it started at.
when flag clicked
set size to (100) %
repeat (6)
change size by (20)
wait (0.15) seconds
change size by (-20)
wait (0.15) seconds
end
Think: the two change blocks cancel out on every pass, so the cat returns to normal each time. Make one of them 25 instead and the cat creeps larger with every beat.
Mini-mission: walking into the distance. Make the cat walk away and appear to get further off, so a watcher reads it as depth rather than shrinking.
It works if: the cat gets smaller smoothly as it travels, a watcher describes it as “walking away” rather than “shrinking”, and it returns to normal size at the start of every run. Stay within 8 blocks.
Think: moving up the screen as well as across is part of the illusion. Which single block do you already know that changes both x and y at once?
Mini-Challenge — the reaction shot 5 min
“Show me how they feel”
Build two reactions using size alone — one that reads as excitement and one that reads as fear — with no words at all.
It works if:
- Each reaction runs from its own cue and uses no say or think blocks.
- A classmate can tell which is which without being told.
- Both reactions return the cat to normal size afterwards.
- Running either one twice gives identical results.
Reveal one valid solution (teacher)
when [e v] key pressed
set size to (100) %
repeat (4)
change size by (15)
wait (0.08) seconds
change size by (-15)
wait (0.08) seconds
end
when [f v] key pressed
set size to (100) %
repeat (3)
change size by (-12)
wait (0.12) seconds
end
set size to (100) %
The interesting discovery is that speed matters as much as direction. A fast bounce reads as excitement; a slow shrink reads as fear. Pupils usually find this by accident and it is worth naming when they do.
Recap 2 min
Size is a percentage of a sprite’s natural size, and it comes with the same two blocks as everything else: one that adds and one that replaces. Change is right for gradual effects; set is right for guaranteeing a known state. Because size sticks between runs, almost every script that touches it should begin with a set-size — otherwise your cartoon looks different every time it plays.
- change size by
- A Looks block that adds to a sprite’s current size.
- set size to
- A Looks block that replaces a sprite’s size with a fixed percentage.
- Percentage size
- 100% is a sprite’s natural size; 50% is half; 200% is double.
- Runaway growth
- What happens when a change block runs repeatedly with nothing to reset it.
Homework 1 min
The pulse that stays put. Build a pulsing sprite and prove it always returns to exactly its starting size.
- Build the six-beat pulse from the medium task.
- Run it five times in a row and check the size afterwards each time.
- Now change one of the two numbers so they no longer cancel, and run it five times again.
- Screenshot both versions and note what happened.
when flag clicked
set size to (100) %
repeat (6)
change size by (20)
wait (0.15) seconds
change size by (-20)
wait (0.15) seconds
end
Bring back next class:
- Your two screenshots and what you observed.
- Your answer to: “Why does the set-size block at the top rescue the unbalanced version, even though the numbers inside the loop are still wrong?”
Heads up for next class: SCR-L01-29 is the arc finale — sprites learn to vanish and reappear, and you ship the finished cartoon.