A falling-sand pixel engine inspired by The Powder Toy, Sandspiel, and Noita.
The simulation, particle interactions, random number generation, and dirty-cell tracking run in Rust/WebAssembly. TypeScript handles browser input and renders the compact list of changed cells to the canvas.
Install Rust,
wasm-pack, and Node.js, then:
npm install
npm run devnpm run build compiles an optimized WASM module and creates the production Vite
bundle. npm test runs the Rust engine tests.
- Dirt falls like sand. Once it stops, it receives a random 5–15 second packing timer that resets if the particle moves again.
- Packed dirt waits 10–60 seconds, then becomes grass if the cell above is empty; otherwise, it starts a new timer.
- Grass runs the same timer and returns to packed dirt if covered. It is also flammable; burning it restores packed dirt instead of creating fire.