draw star (size) define, one tickbox flipped — the star appears in one frame instead of being traced line by line. The Machine draws in a blink.Learning Goals 3 min
By the end of this lesson you will be able to:
- Find the Run without screen refresh checkbox in the Make a Block dialog, and know it lives only on My Blocks.
- Predict whether ticking the box will help or hurt — based on whether the define stack shows animation or just computes a result.
- Use the pen extension to compare an animated square (tickbox off) with an instant square (tickbox on) and explain the difference in your own words.
Warm-Up — Daniel's painfully slow square 7 min
Daniel made a My Block called draw square using the pen extension. Here's his define stack:
define draw square
pen down
repeat (4)
move (100) steps
turn cw (90) degrees
end
pen up
He calls it from when ⚑ clicked. The square draws — but you can see each side appear one at a time, like the cat is dragging a paintbrush slowly. Beautiful, but Daniel wants the square to just appear. What's making it slow?
Reveal the answer
Scratch redraws the Stage after almost every block. move (100) steps finishes, screen refreshes, you see a new line. turn ↻ (90) degrees finishes, screen refreshes, you see the cat rotate. With six visible refreshes inside the My Block, the whole thing takes a noticeable fraction of a second — and you watch it draw.
Today's tickbox tells Scratch "skip those refreshes; just run this whole My Block in a single frame." The square then appears all at once. Same blocks. One checkbox.
New Concept — the tickbox in the dialog 15 min
Almost every Scratch block costs one frame — about 1/30th of a second of visible time. Most of the time that's fine; it's what makes animation work. But sometimes you want a My Block to finish instantly: do all its work, then hand the Stage back to the rest of your script.
Where the checkbox lives
Open the My Blocks palette, click Make a Block. Look at the very bottom of the dialog, below the three input buttons. There's a small label:
☐ Run without screen refresh
Tick the box. Click OK. The define hat looks identical, the callers look identical — but the moment Scratch reaches the caller, it will sprint through every block inside the define before drawing a single frame.
Off vs On — the slow square vs the instant square
Take Daniel's stack above, untouched. With the box off (the default), the square animates: line, pause, turn, line, pause, turn. With the box on, the entire square appears in one frame — pen down, four sides, pen up, all in roughly 0.000001 of a second.
define draw square // Run without screen refresh
pen down
repeat (4)
move (100) steps
turn cw (90) degrees
end
pen up
When to tick it, when to leave it
- Tick it for pure-math My Blocks: blocks whose only job is to compute a number or set a variable. The user shouldn't see "intermediate" frames during a calculation.
- Tick it for instant geometry: drawing a complex shape, stamping a pattern, jumping a sprite to a calculated position.
- Leave it off for animation: walking, dancing, fading, anything where watching the steps happen is the whole point.
- Leave it off if your define stack contains wait (1) seconds or play sound () until done — those blocks need real time to pass.
The mental model — atomic execution
When the box is ticked, the My Block is atomic: it runs as one indivisible chunk, start to finish, before anything else on screen updates. Other scripts pause and wait. The Stage doesn't redraw. Then the My Block finishes and everything resumes.
This is how Scratch makes long calculations feel instant. A "find the prime factors of (n)" My Block can loop a thousand times — with screen refresh, you'd see Scratch hang for a second. With "run without screen refresh", same loop, no visible pause.
Worked Example — the slow square and the instant square 12 min
We'll build the same My Block twice, side by side. Same name? No — call them slow square and instant square. Then compare.
Step 1 — Add the pen extension
Click the blue Add Extension button at the bottom-left of the screen. Pick Pen. A new dark-green block category appears.
Step 2 — Make slow square
My Blocks → Make a Block. Type slow square. Leave the tickbox off. Click OK.
Step 3 — Fill the slow define
Snap under define slow square: pen down, repeat (4) with move (100) steps and turn ↻ (90) degrees inside, then pen up.
Step 4 — Make instant square
Make a Block again. Type instant square. Tick "Run without screen refresh". Click OK.
Step 5 — Fill the instant define
Same six blocks under define instant square. Literally identical content — copy the slow stack with right-click → Duplicate if you like.
Step 6 — Build a caller for each
Two separate scripts, each with a when ⚑ clicked on top. The first calls slow square; the second calls instant square from a different spot (move the sprite to x: 100, y: 0 first so the squares don't overlap).
Step 7 — Click the flag and watch
The slow square draws side by side — you see the line growing. The instant square appears all at once, as if stamped onto the Stage.
Step 8 — Switch the tickbox
Right-click define slow square → Edit. Tick the box. Click OK. Click the flag. Now slow square also appears instantly. Untick it and reset — the animation comes back.
The full caller stack
when flag clicked
erase all
go to x: (-150) y: (0)
slow square
go to x: (50) y: (0)
instant square
What you just felt: the trade-off between seeing the computer work and using the result. Animation = leave the box off. Tools and helpers = tick the box. Pick by purpose, not by habit.
Try It Yourself — three tickbox drills 15 min
Goal: Build draw triangle with the pen extension and the tickbox off. Three sides, 120° turns. Watch it animate. Then edit, tick the box, watch it stamp.
define draw triangle
pen down
repeat (3)
move (80) steps
turn cw (120) degrees
end
pen up
Think: Tickbox off = you watch the artist. Tickbox on = the painting appears. Both are right; pick by mood.
Goal: Build double (n) — a number-input My Block that sets a variable result to n × 2. Tick "Run without screen refresh". Call it three times in a row from a flag hat, each time saying the new value of result.
define double (n) // Run without screen refresh
set [result v] to ((n) * (2))
Think: If you leave the box off, would you even notice a difference here? (Hint: barely, because this block has one block inside. But on a 1000-step calculation, you would.)
Goal: Build spiral (turns) — pen down, then repeat (turns) with move (i) steps and turn ↻ (15) degrees, where i is a variable that grows by 5 each loop. Call with 40. Watch with the tickbox off (animation), then on (instant). Which one looks like art?
define spiral (turns)
set [i v] to (5)
pen down
repeat (turns)
move (i) steps
turn cw (15) degrees
change [i v] by (5)
end
pen up
Think: 40 turns means 40 visible refreshes off, or 1 with the box on. The spiral is the same shape either way — but tickbox off feels like a performance, and tickbox on feels like a logo.
Mini-Challenge — Mei's frozen project 5 min
"Why did Scratch hang?"
Mei built a My Block called forever spin. She ticked the "Run without screen refresh" box because she'd just learned about it. Here's her define:
define forever spin // Run without screen refresh
forever
turn cw (15) degrees
end
What went wrong, and how should Mei fix it?
Reveal the fix
"Run without screen refresh" tells Scratch "don't draw a single frame until this My Block finishes." But the define has a forever loop — it never finishes. Scratch dutifully waits, the Stage never updates, and the project looks frozen. The cat is spinning at infinite speed somewhere in memory; you just can't see it.
Two valid fixes. Either untick the box (so each turn ↻ (15) degrees gets a frame and you see the spin):
define forever spin
forever
turn cw (15) degrees
end
Or change the forever to a finite repeat, so the My Block actually completes:
define spin once // Run without screen refresh
repeat (24)
turn cw (15) degrees
end
The rule: never put a forever inside a "Run without screen refresh" block. The box is for blocks that finish quickly. Forever isn't quick — it's never.
Recap 3 min
You met a single tickbox that quietly changes how every block inside your My Block runs. Run without screen refresh, off by default, makes the define stack animate frame by frame like every other Scratch script. Ticked, the whole define runs in one frame — instant for the user, perfect for calculations and complex drawings. The trick is matching the setting to the purpose of your block: leave it off when you want the user to watch, tick it when you want the user to use the result. And never tick it on a block that contains a forever loop.
- Run without screen refresh
- A checkbox in the Make a Block dialog. When ticked, the entire define stack runs in a single Scratch frame — no visible animation between blocks.
- Frame
- One redraw of the Stage. Scratch normally redraws roughly 30 times per second. Most blocks finish in one frame; ticking the box bundles many blocks into one frame.
- Atomic execution
- Runs all-at-once, indivisibly, with no other script getting a turn in the middle. A "Run without screen refresh" block executes atomically.
- Animation block vs computation block
- A useful distinction: animation blocks show motion over time; computation blocks produce a value or state. Tickbox off for the first, tickbox on for the second.
Homework 2 min
The Same-Stack, Two-Setting Drill. Build one Scratch project with two My Blocks that have identical define stacks but opposite tickbox settings.
- draw star slow — tickbox off. Pen down, repeat 5 with move 80 and turn cw 144, pen up. (Yes, 144° draws a five-pointed star.)
- draw star fast — tickbox on. Same blocks inside.
- Call both from a single when ⚑ clicked: erase all, move to a position, draw star slow, move to another position, draw star fast.
Save as HW-L3-17-Tickbox.sb3. Click the flag and watch both stars draw — one painted, one stamped.
Bring back next class:
- The
.sb3file. - Your answer to: "If you put wait (0.5) seconds at the top of the fast star's define, what happens? Does the tickbox skip the wait? Try it and write what you see."
Heads up for next class: SCR-L03-18 is about refactoring — taking a long messy script and pulling repeated chunks into My Blocks. You'll see one 60-block monster turn into a four-block stack. Today's blocks were tools; next class is the art of using them.