Today, I’m going to work on using worms to generate coral, similar to what I did way back when I was generating omnichromatic images.
In a nutshell:
- Spawn n worms
- On each tick:
- Each worm tries to randomly move one direction
- If it cannot, increment that worm’s
stuck
counter - If it can, restart the
stuck
counter - If a worm is
stuck
long enough, kill it off and spawn a new worm
Eventually, we’ll fill the entire space with colors that end up looking a bit like coral. I’ll probably extend this later, since there are a lot of cool tweaks you can do with this general idea.