← Game of Life
3. Boids
Birds
90
Each bird only sees nearby birds and follows 3 rules. No bird knows there is a flock. Set a rule to 0 and watch the flock fall apart.
All demos
Next: Genetic Algorithm →
World: click a bird to trace it
Zoom: selected bird
The 3 rules: drag to change
1 Separation: avoid crowding
2 Alignment: match velocity
3 Cohesion: move to center
Vision radius R
Flock alignment
FSM: one bird, every tick
Pseudocode, tagged by FSM state