A cellular-automaton sandbox in the spirit of our Game of Life — but messier and more physical. Paint sand, water, walls, oil, fire and smoke, then watch simple per-cell rules pile powders into heaps, pool and spread liquids, race fire along oil and curl smoke upward. Water douses fire, sand sinks through water, oil floats on top. There is no goal — just pour, burn and rebuild. It all runs on your device.
Complex behaviour from a handful of rules. Every cell follows the same tiny instructions — fall if you can, slide diagonally if you can't, sink through anything lighter than you — yet run across the whole grid they add up to piling dunes, pooling water, and fire that chases oil across the screen. It is the same idea behind Conway's Game of Life: no central plan, just local rules producing lifelike, emergent structure. Water douses fire, sand sinks through water, oil floats, smoke rises — all of it falling out of density and a few "if" statements.
How It Works
A grid of materials, a short list of per-cell rules, and interactions that emerge.
1
A grid of cells
The canvas is a grid where every cell holds one material — sand, water, wall, oil, fire or smoke, or nothing. You paint materials with the pointer; the brush drops them in, and gravity takes over from there.
2
Move by density
Each frame, every cell checks the space below it. Powders and liquids fall into anything lighter than themselves, so sand sinks through water and oil, water sinks below oil, and smoke — the lightest of all — rises through everything. When straight down is blocked, powders slide diagonally and liquids spread sideways.
3
Reactions emerge
A few extra rules add the drama: fire spreads to any flammable neighbour and burns out into smoke, water touching fire puts it out, and smoke fades after a while. Nobody scripts a fire spreading along an oil slick — it falls out of one cell igniting the next.
What is a falling sand game?
A falling sand game is a sandbox where you paint different materials — sand, water, fire, oil and more — onto a grid and watch them behave. Sand piles into heaps, water flows and pools, fire spreads and burns out, and the materials interact. There is no goal; the fun is building things and watching the simple rules produce complex, lifelike behaviour.
How does a falling sand simulation work?
Each pixel is a cell holding one material, and every frame the simulation applies a short list of rules to each cell. Sand tries to move down or diagonally down; water does the same but also spreads sideways; denser materials sink through lighter ones; fire spreads to flammable neighbours and dies out; smoke rises. Running these tiny rules across the whole grid produces the emergent piling, flowing and burning you see.
How do the materials interact?
Water douses fire and turns it to smoke; fire races along oil and any flammable it touches; sand sinks through both water and oil because it is denser; oil floats on top of water; and smoke rises up through everything and fades away. Combining materials — pouring water onto a spreading oil fire, for example — is where most of the fun is.
Is a falling sand game real physics?
It is a simplified, cell-based model rather than a full physics simulation — it captures the spirit of gravity, density and flow with cheap local rules rather than solving exact equations. That makes it a cousin of Conway's Game of Life: complex, believable behaviour emerging from very simple rules applied across a grid.