Pursuit and Evasion steering behaviors

In this demonstration, the green vehicle pursues the gray "drone" vehicle, while the red vehicle evades it. The pursuer and evader are initialized with identical random position and velocities. Pursuit (and evasion) are based on an underlying seek (and flee) behavior. An estimate is made of the future position of the gray quarry vehicle based on its position, velocity, and its distance to the pursuer (or evader). This estimated future position is marked with a target symbol (circle and cross-hairs). The green pursuing vehicle uses seek to approach this estimated target position, while the red evading vehicle uses flee to escape from it. Effective prediction is indicated when the target symbol slows to a stop. When the green pursuer reaches the gray quarry, the target symbol will disappear, and the demonstration is restarted. Each vehicle's velocity is indicated by a magenta vector, its steering force is indicated by a blue vector.

From
Steering Behaviors for Autonomous Characters