Turns out it is very simple, the rules for the falling sand for example are implemented with only 10 lines!
Writing it was really fun - I haven't used löve/lua for years. Playing around with it is surprisingly fun too so I decided to share it here.
Considering that I did not spend a lot of time on it I am pretty happy with the result.
The only type of cell that I am not quite happy with is the water. Sometimes it behaves kinda weird and the implementation seems unnecessarily complex.
7 Types of cells are implemented. You can select them by using the number keys and you can "draw" the cells by left clicking.
- Sand
- Water
- (Floating ) Concrete
- Plants - Grows to nearby cells until a certain height is reached
- Eraser - Deletes cells
- Fire - Spreads to and consumes nearby plants. Spawns Smoke Above itself
The source code can be found here: https://codeberg.org/ycake/sandsimulation.