This was a tiny project I made a couple of years ago in an graphics/simulation class to explore steering behaviours from Craig Reynolds’ Boids. I made it initially in C++ but ported it to p5.js. It’s a pretty cool simulation to show emergent behavior from simple rules; super mesmerizing to watch!
Use the sliders to adjust:
Alignment (how strongly the boids align the to the average direction of other boids in the vicinity)
Cohesion (how strongly the boids go to the average position of other boids in the vicinity)
Separation (how strongly the boids avoid each other in the vicinity)