Home▸Animals & Their World▸Nightjar Moth Hunt Lab (2D)

🦉 Nightjar Moth Hunt Lab (2D)

A top-down boids flock: nightjars align, separate and cohere with their flock-mates while each bird also steers toward the nearest moth, with sliders for flock size, moth density, night visibility and wind gustiness.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-nightjar-moth-hunt-lab ↗ Open standalone

This 2D companion drives the same flock-and-hunt behavior as the 3D scene from directly overhead: nightjars fly standard boid rules — align, cohere, separate — while each bird also steers toward the nearest moth and "catches" it within strike range, so the interplay between formation flying and individual hunting is visible directly instead of through a 3D camera.

⚙ Under the hood

2D top-down boids flock (alignment, cohesion, separation) layered with a per-bird hunting steer toward the nearest moth, plus a shared wind-turbulence term that breaks up tight formation flying.

nightjar huntingpredator-preyboids flockingaerial maneuvers2D

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

What did you find?

Add reproduction steps (optional)