How to play
Pick a material in the palette and drag on the dark canvas to pour it in. Every cell of the grid holds one grain of something, and a few local rules decide how it moves and reacts with its neighbours: sand piles up, water finds its level, oil floats, wood burns and lava hardens in water. There is no score and no way to lose.
Start with a preset, then build your own scenes. Brush draws freely. Spout places a source that keeps pouring the selected material; with the Eraser selected it places a drain instead. Pause while you build and use Step to advance one tick at a time. The number under each material counts its grains on the canvas.
Controls
- Mouse: drag with the left button to draw, with the right button to erase. The circle shows the brush size.
- Touch: drag with one finger to draw. The page does not scroll while you draw on the canvas.
- Keyboard: P plays and pauses (Space too when the canvas has focus), S steps, 1–9 and 0 select Sand to Plant, E the eraser, [ and ] change the brush size. On the focused canvas, arrow keys move a cursor, Enter draws and Delete erases.
Rules of the materials
- Sand falls and, when blocked, slides one cell diagonally, so its heaps have 45° sides. It sinks through water, oil and acid.
- Stone is heavy rubble that sinks through every liquid, even lava, and only slides where it can drop two cells, so its heaps are steeper. Cooled lava becomes stone.
- Water falls and spreads sideways; still water shares one level. Oil is lighter, floats on water and burns easily.
- Acid is a heavy liquid that eats sand, stone, wood, plants and ice and is used up doing it. Walls, water and oil resist it.
- Wall never moves; only the eraser removes it. Wood stays in place but burns slowly.
- Fire rises and lives for a moment. It ignites wood, plants and oil and melts ice; water puts it out with a hiss of steam. Burnt material ends as smoke.
- Lava flows slowly and sets fuel alight. Where it touches water, the water becomes steam and the lava becomes stone.
- Steam rises and condenses back into water after a few seconds, at once next to ice. Smoke rises and fades.
- Ice melts next to fire or lava and slowly freezes touching water, a few cells deep. Plant grows into water it touches.
The physics behind it
The canvas is a grid of cells (200 × 150 on wide screens, 120 columns on phones) updated 60 times per second at normal speed. Each step visits the rows from the bottom up, so a grain can fall into a space that was just vacated. Alternating the direction along each row and skipping grains that already moved keeps the motion free of a left or right bias.
Movement is ruled by density. A grain may swap places with a lighter liquid or gas below it, a simple form of buoyancy: sand sinks, oil ends up above water and steam bubbles climb through a lake. Real dry sand settles at roughly 30 to 35 degrees; here a grain moves at most one cell sideways per cell of fall, so heaps settle at 45 degrees.
Falling grains alone do not feel pressure, so water poured into one arm of a U-tube would stay there. To model hydrostatic pressure, the simulator regularly moves a grain from the highest surface of each connected body of still liquid to the lowest free space touching it. This is the principle of communicating vessels: a connected liquid at rest has one level.
Reactions are local too, and a change of state turns one cell into exactly one other: steam becomes one drop of water, lava meeting water becomes stone plus steam. Plain movement only swaps grains, so a closed scene of sand and water keeps exactly the same number of each.
Tips and strategy
- Pour oil on water, add a little fire and watch the burning layer float.
- Place a steam spout under a ceiling of ice to make rain.
- Drop one plant cell into a pond and watch it take over the water.
- Pause, draw sand over water, then press Step to see grains swap places.
Frequently asked questions
Can I win or lose?
No. It is a sandbox for experiments and exploring.
Does it work on a phone?
Yes. Phones get a narrower grid that fits the screen, and it works offline once the page has loaded.
Does the simulator conserve mass?
For inert materials, yes: moving grains only swap places, so sand and water counts stay constant in a closed scene.
Is my scene saved?
It is stored in your browser when you leave the page and restored next time. Save scene keeps a separate copy until you save again.
More free games
- Game of Life – watch patterns grow from simple cell rules.
- Gravity Simulator – build orbits and watch planets swing.
- Flocking Simulator – see a flock emerge from three simple rules.
- Double Pendulum – see chaos appear in a simple machine.
- Minesweeper – clear the field without touching a mine.
- Block Puzzle – fit blocks and clear lines.
- Brick Breaker – bounce the ball and break every brick.
- Snake – grow the snake without hitting yourself.