Move the fox across a field of grazing deer to the far side. A deer that sees you too near becomes afraid, and fear goes from deer to deer. When too many deer are afraid, the guards come for you.
Use the arrow keys or W, A, S and D to walk. Hold Shift to run: it is fast, but the deer notice you from far away. In the tall grass, a deer sees you only when you are very near.
Each deer is a gen_boid process with its fear as its state: calm, alert or afraid. Each level of fear has its own rules: a calm deer grazes, an alert deer stands and looks, and an afraid deer flees.
No code makes a wave. A deer looks only at its neighbors: it becomes afraid when it sees the fox too near, or afraid neighbors. The wave of fear comes from these local decisions.
The data of a boid is what its neighbors see. The fox shows its speed and if it is in the grass. A deer shows its fear and where the fear comes from. Each deer decides from that data.
The force of the fox is a rule of its own: a function that reads your keys. The guards hunt it with the rule pursue of the library.