Falling Sand Game
Paint sand, water and walls on a grid and watch the sand pile into slopes, the water level out and both stop at every wall you draw, a one-cell diagonal line included. Place sources that pour sand or water at the chance per step you set, run at up to 120 steps a second or step one at a time, and save scenes in this browser or as JSON. Every random choice comes from a seed, so a saved scene, left alone, carries on the same way each time you open it.
160 by 120 grid, closed edges, step 0, paused. Sand 232, water 658, wall 215, empty 18,095. 2 sources, on.
- Sand
- 232 cells
- Water
- 658 cells
- Wall
- 215 cells
- Step
- 0, paused
Sources
Choose Source in the brush row, then click a cell or press Space on it to place a source there; do it again on the same cell to remove it. On each step, a source whose own cell is empty adds one cell of sand or water at the chance you set. A scene holds up to 32.
- % a step
- % a step
Checks on this scene
Scenes
Save in this browser keeps the scene under a name, up to 12 scenes. Download JSON writes a versioned file with every cell, the sources, the seed and where the random sequence has reached, so opening it here carries on from the same step. Download PNG saves the grid as an image with sharp square cells.
No scenes saved in this browser yet.
Click or drag on the grid to paint; on a touch screen, drag a finger. With a keyboard, Tab to the grid, move the cursor with the arrow keys (hold Shift to jump 10 cells), and press Space or Enter to paint with the chosen brush. Hold Space while pressing the arrows to paint a line. Painting works while the grid runs or is paused, and on a device that asks for reduced motion the example opens paused.
Common questions
- What is a falling sand game?
- A grid of small cells, each empty or holding a material, updated in steps by simple rules that look only at nearby cells. Here the materials are sand, water and wall: on each step sand falls or slips diagonally, water falls and spreads sideways, and walls stay where you drew them. You paint the materials and watch the grid settle.
- How do sand and water move in this sandbox?
- Sand falls into an empty cell below it, trades places with water below it so it sinks, and otherwise slips one cell diagonally, which builds slopes. Water falls, slips diagonally, or moves up to three cells sideways, stopping over a gap so it can fall in. Nothing squeezes between two wall cells that touch at a corner, so a one-cell diagonal wall holds both. These are stylised rules for play, not real physics.
- Can I play with a keyboard or on a phone?
- Yes. On a touch screen, drag a finger to paint. With a keyboard, Tab to the grid, move the cursor with the arrow keys (Shift jumps 10 cells) and press Space or Enter to paint; hold Space while pressing the arrows to paint a line. Every other control is a button, field or menu you can reach with Tab.
- How do sources work?
- Choose Source and click a cell to place one there; click the same cell again to remove it. On each step, a source whose own cell is empty adds one cell of sand or water with the chance you set, from 1 to 100 per cent, so at 100 it pours on every step. You can change each source's material and chance, or switch all sources off at once. A scene holds up to 32 sources.
- Can I save a scene and come back to it?
- Save in this browser keeps up to 12 named scenes on this device, and the scene you are working on is kept when you leave the page, then reopens paused. Download JSON writes a versioned file with every cell, the sources, the seed and where the random sequence has reached, and Open JSON reads it back. Download PNG saves the grid as an image with sharp square cells.
- What do closed and open edges do?
- Closed edges hold everything in, as if the grid had walls around it. Open edges let any sand or water that moves past the bottom or a side leave the grid for good. With sources off, closed edges and nothing painted or erased, the number of sand, water and wall cells never changes, and the check called Sources off, edges closed runs your own scene for 1,000 steps on a copy to show it.
- What does the seed do?
- When sand or water could slip either way, when water could spread either way, and when a source pours at less than 100 per cent, the choice comes from a random sequence that starts at the seed. Where that sequence has reached is saved with the scene, so the same scene and seed with the same edits give the same grid, cell for cell. Change the seed, or press New seed, to see a different run from the same scene.
- Is there fire, lava or acid?
- No. This sandbox has sand, water and walls, with an eraser and sources to add or remove them. There is no fire, no explosive and no material that reacts with another.
Stylised movement rules for creative play, not real physics or chemistry: sand falls or slips diagonally and sinks through water, water falls and spreads sideways, and walls block both. Each particle moves at most once per step and every random choice comes from the seed, so the same scene, seed and edits replay to the same grid, and with sources off, closed edges and nothing painted or erased, no cell is created or lost. There is no fire, no explosive and no reacting material.