Home▸Animals & Their World▸Firefly Flashing Dynamics (2D)

Firefly Flashing Dynamics (2D)

A pulse-coupled oscillator model of firefly synchronization: each firefly flashes on its own rhythm, but every flash nudges nearby fireflies closer to firing too — watch independent blinking lock into a shared pulse.

Animals & Their World2DModerate60 FPS📱 Mobile-adapted⇄ 3D version
2d-firefly-flashing-dynamics ↗ Open standalone

This 2D companion swaps the 3D version's decorative night-forest scene for the actual mechanic behind real firefly flashing: a pulse-coupled oscillator model. Each firefly ticks toward its own flash threshold at its own natural rate; when it fires, every firefly within the coupling radius gets pulled a step closer to firing too. Turn coupling strength up and a field of independently blinking fireflies locks into a shared pulse within seconds — the same synchronization behavior studied in Southeast Asian firefly swarms.

⚙ Under the hood

Mirollo–Strogatz-style pulse coupling: on each firing event, phasei += K·(1−phasei) for every neighbour within the coupling radius. A live Kuramoto order parameter r = |Σeiθ|/N tracks how synchronized the population is.

firefliessynchronizationpulse-coupled oscillatorskuramoto order parameteremergent behavior

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

What did you find?

Add reproduction steps (optional)