It is night, and groups of fireflies fly over the field. The fireflies that see each other come to flash together. Move the lantern: the fireflies near it follow it. Bring the groups together, until all the fireflies flash at one moment, three times in a row, before the dawn.
Use the arrow keys or W, A, S and D to move the lantern, or click or touch a point of the field: the lantern goes there. The fireflies in its light follow it. Hold Shift (or Fast) to move the lantern faster than the fireflies: it leaves them where they are.
The data of a boid is what its neighbors see. The data of a firefly has the time of its last flash. A firefly reads the data of its neighbors: no message goes from firefly to firefly.
Each firefly has a clock. When it sees a neighbor flash, it moves its own clock a little forward, and more when its own flash is near. That is all. The flashes of a group come together from these small changes.
The number of groups comes from boids:flocks/2: the fireflies that see each other, from neighbor to neighbor. Two groups flash together only when they are one group.
The lantern is a rule of each firefly: a function that reads the place of the lantern. The wind is the rule flow of the library, with a field that is a function.