Home▸Animals & Their World▸Starling Flock — 2D Predator Evasion (Boids)

Starling Flock — 2D Predator Evasion (Boids)

Top-down 2D boids lab: separation, alignment and cohesion steer a flock of starlings while a diving predator triggers panic-flee behaviour within its threat radius — click the sky to add an attractor.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-starling-flock-predator-evasion ↗ Open standalone

This 2D companion runs the same Reynolds boids rules as the 3D version — separation, alignment and cohesion — from a plain top-down canvas view: a diving predator chases the flock centroid, birds inside its threat radius peel away in a fear response, and a click on open sky drops a short-lived attractor the flock steers toward.

⚙ Under the hood

Top-down Canvas2D boids: separation/alignment/cohesion steering forces, a predator that dives at the flock centroid, panic-flee inside a threat radius, and a click-to-attract point.

flockingboidspredator-preyreynolds rulesemergent behavior

2D · HTML5 Canvas 2D · 60 FPS target · runs fully client-side, no install

What did you find?

Add reproduction steps (optional)