Learning Goals 3 min
By the end of this lesson you will be able to:
- Use set size to (100) % to jump a sprite to an exact size as a percentage of its original.
- Use change size by (10) to nudge a sprite a little bigger or smaller — even by negative amounts.
- Build a heart-beat pulse: a repeat (10) that grows the sprite, waits, then shrinks it back.
Warm-Up 7 min
Last lesson the cat came alive with walking animation. Today the cat stays the same — but changes its size to show emotion. A big cat feels dramatic; a tiny cat feels shy. Same sprite, very different feeling.
Quick-fire puzzle
Priya built this stack. The cat started at Size = 100. What did the cat look like after the flag click?
when flag clicked
set size to (50) %
Reveal the answer
The cat shrank to half its original size. Scratch sizes are percentages of the costume's natural size, so 100% is normal, 50% is half, 200% is double. 0% would be invisible (tiny dot). Click the flag again — nothing changes, because the cat is already at 50%.
set size to is a "jump straight to" block. It doesn't grow gradually — it snaps.
New Concept — sprite size is a percentage 15 min
Imagine you're zooming in on a photograph on your phone. At 100%, the photo looks normal. Pinch out — 200%, twice the size. Pinch in — 50%, half the size. Scratch sprites work the same way: a number is a percentage of the sprite's original drawing.
Today's new blocks
| Block | Category | What it does |
|---|---|---|
| set size to (100) % | Looks | Jumps the sprite straight to that exact size. 100 = original, 50 = half, 200 = double. |
| change size by (10) | Looks | Adds the number to the current size. Use -10 to shrink. Many small changes look like smooth growth. |
"set" vs "change" — the two patterns
You'll see this set / change pair on many Looks blocks. The rule is always the same:
- set means "jump to this exact value". Goodbye to whatever the old value was.
- change means "add this much to the current value". Use a negative to subtract.
Example: a sprite starts at Size 100.
- set size to (200) % → size becomes
200. - change size by (10) → size becomes
110. - change size by (-30) → size becomes
70.
The heart-beat pulse
Pair change size by (5) with change size by (-5) inside a loop, and the sprite pulses. Big-small-big-small — exactly like a heartbeat.
Why it matters
Size changes give a sprite emotion. A button that grows when you click it feels alive. A boss that swells before an attack feels scary. A heart that pulses feels romantic. These tiny size-loops add character without changing the sprite's drawing at all.
Worked Example — the heart-beat pulse 15 min
Open Scratch. The cat is fine as your test sprite — we won't change its costume today, just its size. The aim: make the cat pulse 10 times like a beating heart.
Step 1 — Add a hat and reset the size
Drag when ⚑ clicked into the Script Area. Snap a set size to (100) % beneath it. This makes sure every flag-click starts from the same size.
Step 2 — Add the repeat loop
Snap a repeat (10) after the set-size block. The loop runs ten heartbeats.
Step 3 — Grow, wait, shrink, wait
Inside the repeat, snap four blocks in this order: change size by (5), wait (0.1) seconds, change size by (-5), wait (0.1) seconds.
when flag clicked
set size to (100) %
repeat (10)
change size by (5)
wait (0.1) seconds
change size by (-5)
wait (0.1) seconds
end
Step 4 — Click the green flag
The cat pulses ten times. Each pulse takes about 0.2 seconds, so the whole sequence finishes in two seconds. Beautiful.
Step 5 — Tune the feel
Change the 5s to 20s — the cat throbs dramatically. Change the wait to 0.05 — the cat shivers fast. Change the repeat (10) to repeat (3) — the cat gives just a tiny "hi!" pulse.
What changed: compared to last lesson (changing the sprite's costume), today's lesson changes the sprite's size. Same sprite, same costume, very different feel.
The full assembled stack (your reference)
when flag clicked
set size to (100) %
repeat (10)
change size by (5)
wait (0.1) seconds
change size by (-5)
wait (0.1) seconds
end
Try It Yourself — three small builds 12 min
Goal: Shrink the cat in one big jump. Use set size to (40) %.
when flag clicked
set size to (40) %
Think: The cat snapped to 40% of normal in one instant. There was no animation — set size to is an instant jump.
Goal: Make Aisyah's cat grow slowly, in steps. Each press of the green flag adds 20% to the size.
when flag clicked
change size by (20)
say [Growing!] for (1) seconds
Think: Click the flag once — cat is 120%. Click again — 140%. Again — 160%. Without a "set size to 100" at the start, the cat remembers its size between clicks. (To reset, click the red stop sign and add set size to (100) %.)
Goal: Make a "scared cat" effect — the cat suddenly grows huge, says "Aiyo!", and slowly shrinks back to normal.
when flag clicked
set size to (100) %
set size to (180) %
say [Aiyo!] for (1) seconds
repeat (8)
change size by (-10)
wait (0.1) seconds
end
Think: The cat jumps to 180%, says "Aiyo!" (a Malaysian-English exclamation of surprise), then shrinks 10% every 0.1 seconds for 8 steps — landing back at 100%. The growth is instant; the shrink is gradual. Two different feels, one block per feel.
Mini-Challenge — the walking, pulsing cat 5 min
"Hafiz's Cat walks and pulses at the same time"
Combine today's size pulse with last lesson's walking animation. The cat should walk across the Stage and pulse like a heartbeat, both at the same time.
It works if:
- You use a set size to (100) % reset at the start.
- One script handles the walking (forever + move + bounce).
- One script handles the costume animation (forever + next costume + wait).
- One script handles the size pulse (forever + change size + wait + change size + wait).
- All three scripts run when the flag is clicked.
Reveal one valid solution
Three scripts on one sprite. Two from last lesson, one new — the pulse.
when flag clicked
set size to (100) %
forever
change size by (5)
wait (0.1) seconds
change size by (-5)
wait (0.1) seconds
end
when flag clicked
forever
next costume
wait (0.2) seconds
end
when flag clicked
forever
move (4) steps
if on edge, bounce
end
The cat walks, the cat's legs flip, the cat pulses — all from blocks you've learned in the last two lessons. One sprite, three independent scripts.
Recap 2 min
Today you learned two Looks blocks for sizing sprites: set size to (100) % jumps to an exact size, and change size by (10) nudges the current size. Pair them with a repeat loop and short waits — you get a heart-beat pulse, a scary boss-swell, or a button that breathes.
- set size to (block)
- A Looks block that jumps the sprite to an exact percentage of its original size. 100% = original.
- change size by (block)
- A Looks block that adds (or subtracts, with a negative number) to the current size.
- Percentage size
- Scratch describes sprite size as a percentage of the costume's original drawing. 200% = double, 50% = half.
- Pulse pattern
- The repeat-loop combo: grow a little, wait, shrink a little, wait — over and over. Looks like a heartbeat.
Homework 1 min
The Teh-Tarik Heart. Add a heart sprite (from the Sprite library — search "heart") to your project. Make it pulse 20 times, then say "I love teh tarik!" for 2 seconds.
- Open Scratch. Click the "Choose a Sprite" cat-with-plus icon below the Sprite list. Search "heart" and pick the red heart.
- Click the heart in the Sprite list so it's selected.
- Build this stack: when ⚑ clicked, set size to (100) %, repeat (20) with a pulse inside, then a say [I love teh tarik!] for (2) seconds.
- Click the flag. The heart pulses 20 times, then sends its message.
Bring back next class:
- A screenshot of your heart-pulse script.
- Your written answer: "If the heart starts at Size 100 and you do change size by (5) ten times in a row with no shrink in between, what's the final size? What if you do it 100 times?"
Heads up for next class: SCR-L01-29 teaches three more Looks blocks — show, hide, and go to front layer. You'll learn how sprites can vanish, reappear, and stack in front of each other.