Boid algorithm is that simulate flocking behavior in birds. It is also well known that the rule for the behavior is reasonably simple.
- I assume that you have poetry running
- Install dependency
poetry install
- Run by
poetry run python main.py
To see flocking behavior, please click on the pygame window
Also you can run this on repl.it at https://replit.com/@sweemengng/pygame-boids-1
Explanation is here: https://cs.stanford.edu/people/eroberts/courses/soco/projects/2008-09/modeling-natural-systems/boids.html
Pseudocode I use for reference: https://vergenet.net/~conrad/boids/pseudocode.html