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.