Fun
cohesion · alignment · separation
Flock
Bird flocks emerge from just three rules — steer toward the local center (cohesion), match your neighbors' heading (alignment), and push away when too close (separation). This is Craig Reynolds' 1986 Boids algorithm.
Your cursor is a hawk — the flock flees from it. Click the canvas to place an obstacle, click again to remove it. Push the three weights to their extremes and watch the flock scatter, swirl, or clump into a single blob.
Live swarm
Boids field
fps --
boids 0
calm 0 · fleeing 0
obstacles 0