Learning Goals 3 min
- Spawn a particle burst using 5–10 short-lived clones that fly outward in random directions, fade, and self-delete — the technique behind every "thing explodes" effect in games.
- Build a screen-shake macro that briefly offsets one or more sprites by small random amounts for a few frames, then snaps them back — the technique behind every "big hit" punch in games.
- Explain why these effects are called game feel: changes that don't add new gameplay but make existing gameplay much more satisfying.
Warm-Up — same hit, two feelings 7 min
Your Breakout works. Your power-ups drop. Bricks delete cleanly when the ball touches them. Play it. Now imagine the same game with each brick exploding into 8 little orange shards that fly outward and fade, and the whole stage juddering for a tenth of a second on every hit. Same scoring, same physics, same controls — just feels different. That difference has a name: game feel.
Predict puzzle. Look at this clone script for a particle:
when I start as a clone
point in direction (pick random (0) to (360))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
How long does this clone live on screen, and what does it look like during that time?
Reveal the answer
The repeat runs 10 times. Each iteration is about 1/30th of a second on a typical computer, so the clone lives for roughly 0.3 seconds. During that time it moves 50 steps total (5 × 10) in whatever direction the random pick chose, and its ghost effect climbs from 0 to 100 (10 × 10) — meaning it fades from fully visible to fully invisible. Then delete this clone cleans it up so it doesn't sit around forever.
That's a particle: born randomly aimed, moves outward, fades, dies. Today's job is to spawn 8 of them at once from the brick that just got hit.
Second predict. What does this Stage-coordinated shake do?
when I receive (shake v)
repeat (4)
change x by ((pick random (-3) to (3)))
change y by ((pick random (-3) to (3)))
wait (0.02) seconds
end
go to x: (start-x) y: (start-y)
Reveal the answer
Four tiny jitters of −3 to +3 pixels in each axis, 0.02 seconds apart — about 0.08 seconds total, then snap back to the home position. The sprite visibly twitches once, very fast. Do this on every sprite at the same time (via broadcast) and the whole Stage looks like it got punched. The snap-back at the end is critical: without it, the sprite slowly drifts away from where it was supposed to be after each shake.
New Concept — particles + shake as game-feel tools 15 min
Both effects share a structure you've seen before: spawn something temporary, let it do its thing, clean it up. Particles use clones to do this. Shake uses one sprite's own coordinates.
Particles: the explosion pattern
A particle system is just many tiny clones, each born randomly aimed. Three ingredients:
- A spawner. When something happens (brick destroyed), a script runs repeat (8) + create clone of (myself v). Eight clones are born at the same spot.
- A clone behaviour. Each clone runs its own when I start as a clone — picks a random direction, moves outward, fades, deletes itself. Independence is the whole trick: 8 clones, 8 different random directions, 8 separate explosions all happening together.
- A self-destruct. Without delete this clone, particle clones pile up forever until Scratch hits the 300-clone limit and refuses to spawn more. Always clean up.
Particle sprite design
A particle sprite should be small and simple. A 6×6 orange dot, or a 10×10 yellow star. Bright colour, no detail — particles are too tiny and too fast for detail to read. Paint a single costume.
when flag clicked
hide
when I receive (burst v)
go to x: (burst-x) y: (burst-y)
repeat (8)
create clone of (myself v)
end
when I start as a clone
clear graphic effects
point in direction ((pick random (0) to (360)))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
Screen shake: the wiggle pattern
"Screen shake" in Scratch is a small lie. There's no real camera. What we do instead: pick the sprites that should shake (usually the player, the score display, the paddle — not the background or things that look pinned) and briefly jitter their positions in random directions, then snap them back to where they started.
The trick is the snap back. Each shake-enabled sprite needs to remember its home position:
when flag clicked
set [start-x v] to (x position)
set [start-y v] to (y position)
when I receive (shake v)
repeat (4)
go to x: ((start-x) + ((pick random (-3) to (3)))) y: ((start-y) + ((pick random (-3) to (3))))
wait (0.02) seconds
end
go to x: (start-x) y: (start-y)
For sprites that move during play (the paddle, the ball), don't use this exact pattern — their "home" changes every frame. Instead, use the change x by / change y by form and reverse the offsets at the end:
when I receive (shake v)
set [offset-x v] to ((pick random (-3) to (3)))
set [offset-y v] to ((pick random (-3) to (3)))
change x by (offset-x)
change y by (offset-y)
wait (0.05) seconds
change x by ((0) - (offset-x))
change y by ((0) - (offset-y))
When to trigger which
Match the effect to the weight of the event:
- Particles on every brick destroy. Tiny event, tiny burst, no shake.
- Particles + small shake on big hits — losing a life, paddle catching a power-up.
- Big particle burst + bigger shake on rare events — boss defeat, level clear.
If everything shakes, nothing does. Save shake for the moments you want the player to feel.
Worked Example — adding particles + shake to Breakout 20 min
Open your power-up Breakout from L04-34. Today we add two new effects on top.
Step 1 — Paint a Particle sprite
New sprite → Paint. Pick the circle tool, no outline, solid bright orange. Draw a single 8×8 dot. One costume. Name the sprite Particle.
Step 2 — Hide the parent particle
On Particle: when ⚑ clicked → hide. The parent never shows; only the clones do.
Step 3 — Make two helper variables
Make burst-x and burst-y as For-all-sprites variables. The brick will write its position into these before broadcasting burst. (Same handshake pattern as the power-up spawn last lesson.)
Step 4 — Wire the brick's destroy to a burst
On the Brick sprite, find the when I receive (brick-hit v) handler. Add three lines before delete this clone:
set [burst-x v] to (x position)
set [burst-y v] to (y position)
broadcast (burst v)
Step 5 — Burst handler on the Particle
On Particle:
when I receive (burst v)
go to x: (burst-x) y: (burst-y)
repeat (8)
create clone of (myself v)
end
Step 6 — Clone behaviour
On Particle, the actual flying-and-fading:
when I start as a clone
clear graphic effects
point in direction ((pick random (0) to (360)))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
Step 7 — Test the particles
Click flag. Send the ball at the bricks. Each brick destroyed should emit a tiny orange firework. If you don't see particles: check that the Particle parent is hidden (hide on flag), and that you actually broadcast burst from the brick. If particles appear but only in the top-left of the Stage, the brick's burst-x/burst-y set lines are missing or in the wrong order.
Step 8 — Add screen shake on life-loss
Decide which sprites shake. Good choices: the Paddle and the Score display (if you have one). Bad choices: the Background (Scratch can't shake the backdrop) and the bricks (they'd look like they're falling apart). On the Paddle, add the change-and-undo shake handler:
when I receive (shake v)
set [offset-x v] to ((pick random (-4) to (4)))
set [offset-y v] to ((pick random (-4) to (4)))
change x by (offset-x)
change y by (offset-y)
wait (0.05) seconds
change x by ((0) - (offset-x))
change y by ((0) - (offset-y))
Step 9 — Broadcast shake from the life-loss script
Wherever you handle "ball fell off the bottom" (probably a script on the Ball sprite that decrements lives), add broadcast (shake v) just before the wait/respawn. Now losing a life jolts the paddle.
Step 10 — Tune until it feels right
Play 5 rounds. Adjust three knobs:
- Particle count. repeat (8) is the default. Try 4 (sparse) and 15 (showy).
- Particle speed. move (5) steps — try 2 (slow) and 10 (fast).
- Shake size. pick random (-4) to (4) — try (-2) to (2) (subtle) and (-8) to (8) (extreme).
There's no "right" answer. Game feel is taste. Trust your hands.
The full Particle sprite
when flag clicked
hide
when I receive (burst v)
go to x: (burst-x) y: (burst-y)
repeat (8)
create clone of (myself v)
end
when I start as a clone
clear graphic effects
point in direction ((pick random (0) to (360)))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
What you just built: a reusable game-feel layer. The brick doesn't know how particles work — it just shouts "burst at this position". You can swap in different particle colours, particle counts, particle speeds, even particle shapes, without touching the brick. That separation is why game-feel layers ship as separate modules in professional engines.
Try It Yourself — three polish drills 15 min
Goal: Add a second colour to your Particle sprite. Paint a yellow 8×8 dot as costume 2. Each clone, when it spawns, randomly picks costume 1 or costume 2. Mixed-colour bursts feel more vibrant than single-colour ones.
when I start as a clone
clear graphic effects
switch costume to (pick random (1) to (2))
point in direction ((pick random (0) to (360)))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
Think: Two costumes, one tiny script change, suddenly the bursts look twice as expensive. Polish is mostly small composable choices like this.
Goal: Make a directional particle burst. Instead of every clone flying in a random 0–360 direction, make them all fly in a cone based on a passed-in burst-angle (the direction the ball was going). 8 clones spread within ±40° of that angle. Looks like a splash in the direction the ball arrived from.
when I start as a clone
clear graphic effects
point in direction ((burst-angle) + ((pick random (-40) to (40))))
show
repeat (10)
move (5) steps
change [ghost v] effect by (10)
end
delete this clone
Think: Directional particles "remember" the cause of the burst. They look like splashes away from the impact, exactly like real shards from a real broken brick. Same code structure as before — just a different angle source.
Goal: Make particles obey gravity. Each clone has a private velocity-y that starts as a random upward number (3 to 8) and decreases by 1 each frame, like in your platformer lessons. Particles now arc up and curve down instead of flying in straight lines. Looks like sparks from a real explosion.
when I start as a clone
clear graphic effects
set [velocity-y v] to ((pick random (3) to (8)))
point in direction ((pick random (60) to (120)))
show
repeat (15)
move (3) steps
change y by (velocity-y)
change [velocity-y v] by (-1)
change [ghost v] effect by (7)
end
delete this clone
Think: Gravity on particles is the same gravity from your platformer player. The pattern transfers. Every "things that move and fall" effect in games — from particle sparks to coin pops to defeated-enemy bodies — uses this same five-block velocity loop. You're applying one idea in three places now.
Mini-Challenge — the shake that won't stop 5 min
"Daniel's drifting paddle"
Daniel added screen shake to his paddle. After 4 or 5 brick hits, he notices the paddle has visibly drifted upward and to the left, away from the bottom of the Stage where it should sit. By round 3, the paddle is up near the bricks. Here's his script:
when I receive (shake v)
repeat (4)
change x by ((pick random (-3) to (3)))
change y by ((pick random (-3) to (3)))
wait (0.02) seconds
end
Why does the paddle drift, and is the fix the snap-back, or something else?
Reveal one valid solution
Every shake adds 4 random numbers in the range −3 to +3. The average should be 0 — that's how random numbers work. But over only 4 samples, you'll often get an unlucky run where the four numbers sum to, say, +5 instead of 0. After 10 shakes, those small biases pile up: +5, −2, +3, +4, −1... and now the paddle is 9 pixels higher than it started, with no force ever pulling it back down.
The snap-back pattern from the worked example fixes this cleanly:
when I receive (shake v)
set [offset-x v] to ((pick random (-3) to (3)))
set [offset-y v] to ((pick random (-3) to (3)))
change x by (offset-x)
change y by (offset-y)
wait (0.05) seconds
change x by ((0) - (offset-x))
change y by ((0) - (offset-y))
The rule: for a sprite that moves during play (paddle, player, ball), shake by remembering the offsets and explicitly undoing them. Don't trust the average of random numbers to wash out — they don't, especially over small sample sizes. For a sprite that doesn't move during play (a Title sprite, a Score display), the alternative pattern works too: record start-x / start-y on flag-click and go to x: (start-x) y: (start-y) after the shake. Both fix the drift; pick the one that matches your sprite's role.
Recap 3 min
You added game feel to your Breakout — the layer of small effects that doesn't change what the game does but transforms how it feels. Particles: a small sprite hides itself, and on the burst broadcast moves to a saved position and spawns 8 short-lived clones that fly outward in random directions, fade via the ghost effect, and self-delete. Screen shake: any sprite that should react to a big hit listens for shake, jitters its position by ±4 pixels for ~0.05 seconds, then snaps back. Both effects spawn temporary motion and clean themselves up; both are triggered by broadcasts so the rest of your code never has to know they exist.
- Game feel
- The collection of small, non-gameplay effects (particles, shake, sound, brief pauses, juice) that make game actions feel weighty and satisfying. Doesn't change what the game does — changes how each action lands.
- Particle
- A short-lived clone that flies in a random direction, fades, and deletes itself. Many particles together form a burst. Each burst lasts ~0.3 seconds.
- Screen shake
- Briefly offsetting one or more sprites by small random amounts to simulate a camera punch. In Scratch (no real camera) we jitter individual sprite positions and snap them back.
- Snap-back
- Returning a shaken sprite to its starting position at the end of the shake. Without it, random offsets accumulate and the sprite drifts away from where it belongs.
- change-and-undo
- The shake pattern for sprites that move during play. Store offsets in variables, apply them, wait, subtract them. Works even while the sprite continues moving on its own.
Homework 2 min
The Three-Effects Drill. Take your power-ups + particles Breakout and add three more game-feel touches.
- Sound on particle burst. A short pop or pluck sound on every brick destroy. Scratch library → Sound → Pop, or Effects → Zoop. start sound (pop v) in the when I receive (burst v) handler, before the spawn loop.
- Bigger shake on power-up catch. When the paddle catches a power-up, broadcast a new big-shake. Same shake structure but offsets of ±6 instead of ±3, and 2 repeats so it lasts a bit longer (about 0.1s). The catch should feel different from a regular brick hit.
- Particles on the paddle when it catches a power-up. Same Particle sprite, second use. Save the paddle's position into burst-x / burst-y and broadcast burst. Free particle effect because we built the spawner generically.
Save as HW-L4-35-Polished-Breakout.sb3.
Bring back next class:
- The
.sb3file. - Your answer to: "Show your game to one person who hasn't seen it before. Watch their face. What was the moment they smiled (or said 'oooh')? Which polish detail caused it?"
Heads up for next class: SCR-L04-36 is the Cluster F capstone Build — the complete Breakout clone. We pull together paddle physics from L04-33, brick clones from L04-32, power-ups from L04-34, today's polish, plus a title screen and game-over screen, into one shareable game. About 90 minutes. Bring your most polished version of today's project — it's the starting point.