Duckling Line

You are a mother duck. Swim near a lost duckling, and it joins the end of your line. Lead the line around the rocks, the reeds and the pikes to the nest. Swim slowly: a duckling that cannot follow leaves the line.

Connecting
You, the mother Ducklings in the line Lost ducklings Pikes The nest

Collect the lost ducklings, and lead them to the nest.

Use the arrow keys or W, A, S and D to swim. Hold Shift to hurry: you are fast, but the ducklings cannot follow you. A pike scares the ducklings near it.

The line is a chain of relations

A duckling that joins gets the relation follows to the last boid of the line, with boids:relate/4. Its rule leader has the target {related, follows}: it follows its leader, and does not know the line. The lines on the water show the relations.

A relation that goes

A duckling that is too far from its leader for 2 seconds removes its relation with boids:unrelate/4. The ducklings behind it still follow it: they are a short line that waits for you.

A duckling knows its line

A duckling goes up its chain of leaders with reads of the world, and asks no process. When the chain comes to the mother, the duckling is in the line, and its data tells that to its neighbors.

The mother is a boid that you control

The force of the mother is a rule of her own: a function that reads your keys. A rule avoid of the library moves her around the rocks and the reeds.

Read the code of the game.