Boids are driven by 3 rules:

In this sketch, the black boid moves toward the average position of the white boids, but also moves toward the center of the screen.
The white boids move away from the black boid.

Source code: boids_02 Boid

Built with Processing