Introducing Terrarium: Flora
It has been two months since I last updated my WIP called Terrarium. At the time I was at storage capacity and really struggling to find space to add new features. The easy thing would have been to just call it done and move on, but it felt so…unsatisfying.
As I stared at the code for the gazillionth time I realized I could optimize the water system by simplifying some underlying assumptions. Unfortunately this would have been difficult to retrofit into the existing code. So I started over
I basically rebuilt the project from the ground up with storage space in mind - something I didn’t do with the original. Note I include blinklib in the project because I modified it to save a bit of code space.
Some notable changes for those familiar with the old version:
- All code is contained within one sketch. No more asymmetric tiles.
- Drippers and dirt no longer take up a full tile.
- Sun tiles and sunlight in general has been removed. It just wasn’t fun to manage given the code space it occupied. (Ask me about the rainbows I had implemented at one point.)
In addition, since plants are the spotlight of Terrarium: Flora:
- Two new plant types: vines and seaweed. These are in addition to the standard tree-like plant.
- Vines grow when the dirt is rotated downward before growing has started. Vines will always grow down.
- Conversely, seaweed grows up, but only from a tile that is submerged in water. It will always stay under the water level.
- You can tell the difference between the plant types by their leaf color.
- Trees will now only begin growing when the dirt tile is facing upwards.
How to play
This project really shines when you have a lot of tiles. Use as many as you can!
Once your tiles are programmed you’re going to want two things: water and dirt.
Double-click a tile to turn it into a dripper.
Drippers have one face colored cyan. Water will drip down from this like an icicle. You can control the rate at which it drips by clicking the tile. There are three dripping rates.
Note that the dripper tile also determines the direction of gravity. It will tell all the other tiles which way water should fall. If you have two drippers in the same cluster that are facing different directions things will probably not behave as you expect!
Water in all tiles evaporates at a slow rate. This prevents a single dripper from filling up the world. Unless you want that to happen! If so, turn the dripper on full blast (and maybe create a second or third).
Double-click a dripper tile to switch it to dirt.
The bottom three faces are filled with dirt. Water that falls onto these faces will be absorbed, up to a point. Eventually they become saturated and start leaking.
Normal dirt tiles won’t do anything. But, if you click them you toggle them into a “fertile” state, as represented by a slight green tinge to the center face.
Fertile dirt tiles are ready to start growing a plant. All it needs is a water source.
Growing your first plant
Put all this together and you’ll get your first plant!
Plants sprout out of the faces next to the dirt. As your plant grows it will expand into neighboring tiles. Give it the room to grow and it will get rather large!
- Double-clicking a dirt tile will change it back to a normal blank tile. Be careful, though, as this will quickly kill any plant that was growing.
- Clicking a tile quickly five times (five-clicking?) will erase everything in it and reset its state. Useful for controlling plant growth, eliminating excess water, or just starting over.
- You can graft plants by moving a grown branch from one part of a plant to another (or to an entirely different plant).
- Unhappy plants will wither and die. This may happen if they lose their water source or get too much water and become submerged. Vines and seaweed will die if rotated opposite how they should grow.
- Sprout a flower on your tree and you might be rewarded with a flying critter for your world.