- Learnt28 min · why Scratch is slow, and the tickbox
- Basic24 min · both versions, side by side
- Challenge 1–327 min · when it is wrong, 200 sparks, the rule
- Extrabonus · a show that uses both
Review — where we got to 5 min
define launch (x) (height) (sparks)takes inputs.- The ovals in the hat are dragged into the body.
- An input only exists inside its own definition.
Quick-fire
You change repeat (14) to repeat (200) in your launch block. What do you expect to see?
Reveal the answer
Most people say “a huge firework”. What you actually get is a slow trickle of sparks lasting several seconds. Today is about why, and the one tickbox that fixes it.
Today’s Topic 3 min
- What Scratch does between two blocks
- Run without screen refresh — the tickbox in the Make a Block window
- When to tick it, and when ticking it ruins everything
- A show that uses both
Learning outcome
By the end of this lesson you will be able to:
- Explain why a loop of a hundred blocks takes a noticeable time.
- Turn screen refresh off for a block, and say what changed.
- Decide which of your blocks should have it on and which should not.
Learnt — what happens between two blocks 28 min
1 · Scratch redraws, constantly
Scratch runs your blocks and repaints the Stage about thirty times a second. Between one block and the next, it may stop to redraw everything.
That is what makes glide (1) secs to x: () y: () look smooth — you see every step. It is also why a loop that makes sixty clones takes about two seconds: sixty clones, sixty redraws.
define big burst
show
go to x: (0) y: (-170)
glide (0.4) secs to x: (0) y: (90)
hide
repeat (60)
create clone of [myself v]
end
How to use this: Click the green flag and watch the sparks arrive. Count them if you can — they come one at a time.
2 · The tickbox
- Right-click your define hat and choose Edit.
- At the bottom of the window there is a tickbox: Run without screen refresh.
- Tick it and click OK.
- Run the same project again.
Nothing in the blocks changed. The whole definition now runs to the end before Scratch redraws the Stage even once — so the sixty clones all appear in the same frame.
How to use this: Click the green flag. Same sixty sparks as the demo above — but look how they arrive.
3 · When you should NOT tick it
Anything the audience is meant to watch happen needs the redraws. Tick the box on a countdown and it counts 3, 2, 1 inside one frame — which looks like nothing at all:
define count down
set [count v] to (3)
repeat (3)
say (count) for (0.7) seconds
change [count v] by (-1)
end
define count down
set [count v] to (3)
repeat (3)
say (count) for (0.7) seconds
change [count v] by (-1)
end
Here is the rule, and it is short:
| The block… | Refresh |
|---|---|
| builds something that should appear finished | OFF |
| performs something you are meant to watch | ON |
Basic — both, side by side 24 min
You cannot show a difference with one of something. Build both, in one project, and run them one after the other.
Step 1 — the slow one
- Make a block called
slow burst. Leave the tickbox alone. - Inside: go to the left of the Stage, hide, and
repeat (40)making clones.
Step 2 — the fast one
- Make a second block called
fast burst, identical, but on the right. - This time tick Run without screen refresh.
Step 3 — count them
- Make a variable
sparks madeand show it. - Bump it inside both repeats, so you can see the number climbing or jumping.
Step 4 — run them in turn
- Under the green flag: say which is coming, call the slow one, wait.
- Reset the counter, say which is coming, call the fast one.
Step 5 — watch the counter, not the sparks
- Run it and watch only the number.
- On the left it counts up. On the right it jumps to 40.
when flag clicked
set [sparks made v] to (0)
say [On the left: refresh on.] for (1.5) seconds
slow burst :: custom
wait (2) seconds
set [sparks made v] to (0)
say [On the right: refresh off.] for (1.5) seconds
fast burst :: custom
How to use this: Click the green flag and watch the sparks-made box. Left: it climbs. Right: it jumps.
Both bursts look the same.
The tickbox did not take. Right-click the define hat, choose Edit, and check it really is ticked for fast burst and not for slow burst.
Scratch freezes when I run it.
There is a forever loop or a very long repeat inside a refresh-off block. That block never gives the Stage a chance to redraw.
The fast one appears but the slow one does not.
The wait between them is too short, so the slow one is still going when the fast one starts. Give it two seconds.
The sparks all pile up in the corner.
The clone script’s point in direction is missing, so every spark flies the same way.
Tick the wrong box
Find out what refresh-off does to something that is meant to be watched.
- A countdown block with the tickbox ON. Run it.
- The same countdown with it OFF. Run it.
- Write down, in your own words, what the tickbox actually did.
How to use this: Click the green flag. The first countdown is refresh-off — watch carefully, you will miss it. The second is refresh-on.
Teacher note
Push them off “it was too fast”. Nothing was faster — the says still took their 0.7 seconds. What happened is that the Stage was never redrawn during the block, so there was no moment at which a 3 was on screen to be seen. That distinction is the whole lesson.
Two hundred sparks
Make a firework that would be impossible with refresh on.
- A burst of two hundred clones.
- It appears in one frame.
- The project does not slow to a crawl afterwards.
How to use this: Click the green flag. Two hundred sparks at once — try to count the moment they arrive.
Teacher note
Scratch caps clones at 300, so this is close to the limit — a good moment to mention that limits exist. If a pupil asks for a thousand, let them try: the clones simply stop being created, silently.
One project, both settings
Use the rule properly: a journey you watch, and a burst you do not.
- A
walk the rocketblock that moves it across the Stage, refresh ON. - A
burstblock, refresh OFF. - Both in the same show, and both look right.
How to use this: Click the green flag: the rocket travels across so you can follow it, then bursts all at once.
Teacher reveal — the test to apply
Ask of each block: would a half-finished version of this make sense to look at? A rocket half way across: yes, that is the point. A burst with 30 of its 60 sparks: no, that is just a broken firework. Half-finished-makes-sense means refresh on.
A show that uses both
Four fireworks, each one a flight you can watch followed by a burst you cannot. Split your launch block in two to do it.
fly to (x) (height)— refresh ON.burst (sparks)— refresh OFF.- Four flights and four bursts, over two hundred sparks, all smooth.
How to use this: Click the green flag and watch four rockets fly and burst. Follow one up with your eyes.
Teacher reveal
define fly to (x) (height)
show
go to x: (x) y: (-170)
glide (0.35) secs to x: (x) y: (height)
hide
define burst (sparks)
repeat (sparks)
create clone of [myself v]
end
Two blocks, and only the second one is ticked. The interesting question to put to the class: why can these not be one block with the tickbox half on? Because the setting belongs to the whole definition — which is a real constraint, and the reason the split is forced rather than chosen.
Summary 5 min
- Scratch redraws the Stage between blocks, which is what makes movement smooth.
- Run without screen refresh makes a whole definition finish before the next redraw.
- It does not do less work. It just does not let you watch.
- Tick it for things that should appear finished; leave it for things to watch.
- A very long block with it ticked will freeze the project until it ends.
- Screen refresh
- Scratch repainting the Stage, about thirty times a second.
- Frame
- One of those repaints.
- Run without screen refresh
- A My Block setting: finish the whole definition before repainting.
- Freeze
- What happens when a refresh-off block runs too long.
Hand in
Save your show. Next lesson is the last of the arc: taking a long script that already works and giving its parts names — without the audience noticing anything at all.