Protect Your Plant -- and now the weather

I'm trying to figure out the best way to do rain in the game.

Posted January 12, 2022, 9:54 PM

At this point, I've at least got a version of pretty much every feature the game will need, but some of them are really crude, and I want to improve them before going back to building levels. Case in point, the rain.

The video in this gallery is an example of what I have now (the video is a little old so some art assets are outdated/placeholders, but it still works this way).

Basically there's an area with a ton of copy-pasted animated sprites of rain, when a random number churns out the right value, the game flips on a rainstorm. Then there's a recheck 'hourly' in game time to see if the storm continues, intensifies, diminishes, or stops. This changes the amount of water the player gets while in the rain, and the number of layers of animated sprites showing rain. I know this isn't a good way to do it.

What I want to make:

efficient large rainstorms that vary in intensity and shape and move slowly across the map, while not covering/affecting designated dry spaces.

What I think I want:

to use a tilemap and animatedtextures with collision to detect the player

to create the shapes of the storms with code

I know people use code to generate entire levels in tilemaps, so this should be possible, but I'm not terribly familiar with the algorithms used to paint in spaces, and am learning as I go. It should be interesting.