Visualizes the collective movement of agents (boids) following simple rules to mimic natural flocking behavior. Each boid follows three rules: separation (avoiding crowding neighbors), alignment (matching velocity with nearby boids), and cohesion (steering towards the group’s center). The simulation dynamically adjusts to changing environments, creating emergent, lifelike swarm behavior.
pip install -r requirements.txt
python ./src/main.py
- Press
w
key to move forward. - Press
d
key to steer clockwise. - Press
a
key to steer counter-clockwise. - Press
SPACE
key to speed up. - Press
q
key to summon Boids.
e1
c0 _______ c1
| |
e0 | | e2
|_______|
c3 e3 c2