Flocking
Local Rules
Flocking does not require one controller to plan every movement. Each enemy reacts to a limited number of nearby neighbors.
Separation
Nearby enemies push away from one another so they do not occupy the same space.
Alignment and direction
Enemies borrow some direction from nearby movement while still responding to targets, walls, and the current movement mode.
Program Stub
A small flocking demonstration can be linked here.