Star Student Builder logoStar Student BuilderA Learnerโ€™s Guide
โ† Real Games Std 6โ€“8Project 3 of 4

Rain, Snow and Clones

๐ŸŽฏ Hundreds of raindrops fall, each its own object, from a single sprite.

๐Ÿ’ก The idea behind it

A clone is a copy of a sprite made while the program runs. This one idea is behind bullets, enemies, particles and almost every real game.

๐Ÿงฑ Blocks you will need

create clone of myselfwhen I start as a clonedelete this clonepick randomhide / show

๐Ÿ”จ Build it

  1. Draw one small raindrop and hide the original sprite.
  2. Main: forever โ†’ create clone of myself โ†’ wait 0.1 seconds.
  3. when I start as a clone: go to x (pick random โˆ’240 to 240) y 180 โ†’ show โ†’ repeat until y position < โˆ’170 โ†’ change y by โˆ’10.
  4. Then: delete this clone. This line is not optional.
  5. Change the wait and the fall speed and watch a drizzle become a storm.

๐Ÿš€ Make it harder

  • Make snow instead: slower, and drifting sideways with a small random x change.
  • Make the drops splash โ€” switch costume when they reach the bottom, before deleting.

๐Ÿž Bugs you will hit

  • Scratch slows to a crawl and then stops making clones: you never deleted them. Scratch allows 300 at once, and without 'delete this clone' you hit that limit in half a minute.
  • Nothing appears: the clone needs 'show', because it inherited the hidden state of the original.

โฌ‡ Need Scratch itself?

Free from MIT, in a browser or as an offline app that needs no connection at all.

Get it โ†’
Ask GuruAcharya Samayeshwar