Particle Life
Two thousand dumb dots. Five colours. A tiny table of twenty-five numbers deciding who pulls who. Nobody draws a single frame — and life appears.
The premise
Emergence is the idea that simple rules, repeated, produce complexity nobody wrote down. Water molecules aren't wet. One neuron can't think. This is that idea you can hold in your hand.
Each particle carries a colour and obeys one rule: how strongly every other colour attracts or repels it. Feed a 5×5 matrix of twenty-five numbers to two thousand particles and structure self-organizes — clusters, chains, membranes, rotating arms. Nothing is scripted; it's the product of physics, not intention. Change the numbers and an entirely different life appears.
The one idea that makes it work
A repulsion floor, then an attraction well
The first version only ever pulled — and a pull with no floor is strongest at zero distance, so everything collapsed into dead blobs or flew apart into dust. The fix is the shape of one curve: push particles apart when they crowd, pull them back when they drift. They settle at a held gap of exactly β·R = 30 px — and grey dust wakes into a galaxy.
Four worlds, one engine
The same two thousand particles. Only the table of numbers changes — and the whole universe reorganizes into something else alive.
Galaxy
cyclic pursuitEvery colour chases the next in an unclosable loop. The result never stops turning — pinwheels, curling arms, a living spiral.
Cells
cohesion + repulsionColours cling to their own kind and wall out strangers, with two quiet bridges. They settle into membranes — tissue that holds its shape.
Soup
a food chainA gentle ecosystem: A chases B, B chases C. Predators and prey drift in a restless, never-quite-still equilibrium.
Chaos
pure pursuitEvery relationship is a chase and nothing is ever mutual. Structure forms only to tear itself apart — motion that never settles.
Under the hood
The two-zone force
A universal repulsion floor below β·R, then an attraction well beyond it. That single curve is the whole difference between dead dust and a living galaxy.
O(N) neighbours
A spatial hash buckets the world into cells the size of the interaction radius; each particle checks only its 3×3 neighbourhood. ~4,000,000 comparisons a frame collapse to ~100,000.
GPU rendering
WGSL point sprites with a real bloom pass — 4× downsample → gaussian → additive composite — over a WebGL2 fallback so the look never degrades.
Deterministic
A fixed 60 Hz timestep and a seeded RNG: behaviour is framerate-independent, and the same seed replays the exact same universe, frame for frame.
Shareable universes
Every world is a short ?s= link — matrix, seed and count in one URL. Open a stranger's and watch the identical galaxy assemble on your screen.
Discover
A random-rule search scores thousands of matrices for cluster count and motion, surfacing brand-new worlds worth keeping.
Built framework-free in TypeScript so the engine runs headless in Node — the physics is unit-tested, and the pair really does settle within a pixel of β·R.
By the numbers
Build a universe from twenty-five numbers.
Drag the matrix, watch life reorganize in real time, then share the exact universe you made as a single link.
Launch the simulationOther Projects
0202
Creature Evolution
2D creatures made of joints and muscles start helpless. A genetic algorithm mutates them across generations until they discover how to move.
0303
Mind Map
Type a sentence. Watch a real language model decide which words matter to understand each other word. The invisible mechanism inside every AI — made visible.

