A List of Things
Everything so far has animated one thing. Rain needs a hundred.
You are not going to write x1, x2, x3. You already know the answer — a
list.
That's three raindrops, at rows 0, 3 and 6.
Moving all of them
Loop over the list and move each one:
Note state["drops"][i] = ... — you're changing the item inside the list.
This is the pattern that trips people up:
drop is a copy of the number. Adding to it changes the copy and throws it
away. To change the list you have to say which slot you're changing, and
that means looping over the index.
Drawing all of them
Same shape, in draw:
8 + i * 10 spreads the drops across the picture: drop 0 at column 8, drop
1 at column 18, drop 2 at column 28. Using the index for position is a
handy trick — no second list needed.
One loop each, not one loop for both
update loops to change numbers. draw loops to paint. Same list, two
separate passes.
It might look like you could do both in one loop and save a few lines. Don't. The moment you want to draw something twice, or update twice per frame, or skip drawing while paused, the merged version fights you.