Scratch lesson 18 of 20 · Advanced · About 45–60 minutes
Build a meteor shower that can run for several minutes with the same small group of clones. Give each meteor its own speed and measure how many times the group reuses a clone.
What you’ll make Make a night-sky scene with a reusable pool of 12 meteors and a ten-second activity counter.
Get ready
Open the Scratch editor (opens in a new tab) and start a new project.
- Start a new Scratch project. Paint the Stage backdrop dark blue. Mark a few distant stars with small dots, leaving the playing area clear.
- Paint a tiny, bright sprite called Meteor. Use a small oval and a short tail, with the costume centred on the crosshair. At the default sprite size, keep the picture about 20 pixels high so it can fully travel across the stage.
- Make Pool size, Ready, Flight, Reuses and Sample reuses as variables for all sprites. Leave the Ready and Sample reuses monitors visible. On Meteor, make Slot and Fall speed using For this sprite only.
To keep your project, choose File → Save to your computer in Scratch.

Build it in Scratch
Choose the sprite named above each stack. The colours help you find the block categories. Indented rows sit inside the block above. Follow the end marker to see where each loop or condition closes.
1. Set the size of the pool
A pool is a fixed group of objects that take turns doing the same job. The Stage sets every shared counter first, then sends Build pool. Use broadcast and wait so the Stage waits for the original Meteor's short build script. The clone scripts run under their own hats. Ready counts the clones that have begun their scripts. The Stage waits for the whole group, then starts the timer and sets Flight to 1 so the clones can begin falling. The display shows Sample reuses as zero until ten seconds have passed.
when green flag clickedset [Pool size] to (12)set [Ready] to (0)set [Flight] to (0)set [Reuses] to (0)set [Sample reuses] to (0)broadcast [Build pool] and waitwait until <(Ready) = (Pool size)>reset timerset [Flight] to (1)wait until <(timer) > (10)>set [Sample reuses] to (Reuses)2. Give every clone a different slot
Choose Meteor. Add this short receiver to the original sprite. hide keeps the original out of sight as a template. Each time you raise Slot and create a clone, the new clone copies that value. The original goes on to the next number while the earlier clone keeps its own. By the end, the clones have slots 1 to 12. The script can finish because create clone of [myself] starts each clone's separate script without waiting for that script to finish.
when I receive [Build pool]hideset [Slot] to (0)repeat (Pool size)change [Slot] by (1)create clone of [myself]3. Make a clone fall and recycle
Add this new Meteor script with the when I start as a clone hat. Build mod from Operators. It gives the remainder after division, so dividing the slot number by 4 makes four possible speeds, from 3 to 6. Each clone waits for the Stage's Flight signal before a short delay that staggers its start. The x calculation makes one lane per slot: start at −210, then add 32 for each slot. In the loop, each meteor moves down a little and waits briefly so the stage can update. Below y = −150, it records one completed trip and starts the next from the top. Keep create clone of [myself] in the build script. Recycling a meteor moves the same clone back into position.
when I start as a cloneset [Fall speed] to (((Slot) mod (4)) + (3))change [Ready] by (1)wait until <(Flight) = (1)>wait ((Slot) * (0.15)) secondsforevergo to x: (((Slot) * (32)) - (210)) y: (155)showrepeat until <(y position) < (-150)>change y by ((0) - (Fall speed))wait (0.04) secondschange [Reuses] by (1)Test your project
- Click the green flag and check Ready reaches 12. The meteors should appear in staggered lanes and some should move faster than others.
- Keep the shower running for ten seconds. Sample reuses should eventually show a snapshot. With Reuses visible, check that it keeps climbing while Ready stays at 12.
- Let it run for another minute. Look for any slowdown or increase in the number of moving lanes. Then click Stop and the green flag again. Check that counters and meteors start fresh.
- Change Pool size on the Stage to 6 and run another ten-second trial. Compare the snapshot and how smoothly the animation feels on your device. Record the number of completed trips and how steadily the animation appears as two separate observations.
If something goes wrong
- Every meteor starts in the same lane.
- Make Slot for this sprite only. Raise Slot before creating each clone, and leave the blue go to block under the clone hat.
- Ready reads 12 but the meteors are invisible.
- Wait for the short stagger, then check that show sits in the clone loop. Keep hide in the original Meteor's receiver.
- The Stage never takes a sample.
- Check that Ready is for all sprites and increases once per clone. Keep the forever loop in the clone script. The Build pool receiver must finish before broadcast and wait can complete. Once Ready reaches Pool size, the Stage must set Flight to 1.
- A meteor gets stuck below the Stage.
- Keep the re-entry threshold at −150 so it finishes while the centre of the costume can still reach the test value. Check that the condition is y position less than −150, and subtract the Fall speed from zero so the meteor goes down.
Make it your own
- Use two costumes, one pale meteor and one bright meteor. Switch costume just before show, based on whether Slot mod 2 is zero.
- Change the re-entry position to a random x value between −190 and 190. Compare the look with fixed lanes. Keep the pool bounded and check that every visible meteor still finishes a trip.
- Try a fixed Pool size on two devices. Record whether the animation keeps a steady pace and how many trips the sample records. Explain what each observation can tell you.
What you’ve learned A clone can keep private state and recycle itself. A bounded pool makes clone count predictable, so you can measure behaviour and change one setting at a time.