⚡ G-Warp

Tutorial 6: Make falling stars with clones

You will make: a star that appears near the top of the Stage, falls down, disappears, then repeats. The important blocks are create clone of [myself], when I start as a clone and delete this clone.

Step 1 — Prepare the star

  1. Select a small star sprite, or paint a simple star costume and keep the design light.
  2. Make sure the sprite fits on the Stage. Save the project before adding the scripts.

Step 2 — Make the spawner

On the original star sprite, make this script. It hides the original so only the falling copies are seen.

when flag clicked
hide
forever
  create clone of [myself v]
  wait (0.3) seconds

Find create clone of [myself] in Control and leave its dropdown on myself. The short wait controls how often new stars appear.

Step 3 — Make each clone fall and clean itself up

Add a separate script on the same sprite:

when I start as a clone
go to x: (pick random (-220) to (220)) y: (170)
show
repeat until <(y position) < (-170)>
  change y by (-5)
  wait (0.03) seconds
delete this clone

Use pick random (-220) to (220) from Operators, y position from Motion, and repeat until, change y by (-5), wait (0.03) seconds and delete this clone from the matching palette categories. Keep delete this clone after the repeat loop, not inside it.

Step 4 — Test safely

  1. Click Start. Stars should fall from different positions near the top of the Stage.
  2. Try changing wait (0.3) seconds to wait (0.5) seconds for fewer stars. Shorter spawner waits create more clones and can slow the project.
  3. Press Stop when finished. Save, reopen the project and check the scripts are still connected.

Important: the normal clone limit is 300; the optional Infinite Clones setting has a reported safety ceiling of 5,000. A clone that is not deleted can keep using resources. Keep delete this clone in the falling script and start with a slow spawner.

← All tutorials · Block categories · Clone and performance tips