mljr.eu
Back

Particle Life

Five particle colors, a random attract/repel rule between every pair of colors, and nothing else — hit Randomize to roll a new rule set and watch completely different life-like structures emerge.

How it works

Unlike Boids, there's no flocking rule here at all — just a random number between -1 and 1 for every pair of the five particle colors, saying how strongly that pair attracts (positive) or repels (negative) at close range. Every particle only ever feels forces from whichever other particles happen to be within its interaction radius.

All particles get one universal force curve regardless of color: hard repulsion at very close range so they never fully overlap, then the pair's own attract/repel value takes over further out, fading to nothing at the edge of the interaction radius. Only that single number differs between color pairs — everything else about the physics is identical.

Structures that look designed — orbiting clusters, chase-and-flee chains, one color's particles trapped inside a shell of another — all fall out of that one random rule table, with nothing resembling a chase or a cluster written anywhere in the code. Press Randomize for a completely different rule set and, often, a completely different kind of emergent structure.

one attract/repel value per color pair...applied to every particle, every frame