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
- Draw one small raindrop and hide the original sprite.
- Main: forever โ create clone of myself โ wait 0.1 seconds.
- 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.
- Then: delete this clone. This line is not optional.
- 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.