Boids Simulation
This is a simulation of Boids, an algorithm that models the flocking behavior of birds and other animals that move in groups.
How Boids Work:
- Separation: Boids avoid crowding together and colliding with each other.
- Alignment: Boids align their velocity with the average velocity of nearby boids.
- Cohesion: Boids steer towards the average position of nearby boids.
Controls:
- Left-click anywhere on the canvas to spawn new Boids and create a "danger zone" that they will avoid.
- The danger zone is marked by where you clicked. Boids will steer away from this area to avoid collisions.
- As Boids move, they follow the natural behaviors of separation, alignment, and cohesion, making them flock together while avoiding collisions.
- You can adjust the Boid Limit at the top-left of the screen to control how many Boids can exist in the simulation at once.
- Click the Clear button to remove all Boids and reset the canvas.
Enjoy the simulation!