https://github.com/burnycoder/bird-flocking
Browser-based simulation demonstrating emergent flocking behavior, referred to as "boids", with group of agents (birds) following a set of simple rules, resulting in complex, life-like flock movement patterns, using HTML, CSS (with Tailwind CSS for styling), and JavaScript for the logic and rendering on an HTML Canvas.
https://github.com/burnycoder/bird-flocking
Last synced: 4 months ago
JSON representation
Browser-based simulation demonstrating emergent flocking behavior, referred to as "boids", with group of agents (birds) following a set of simple rules, resulting in complex, life-like flock movement patterns, using HTML, CSS (with Tailwind CSS for styling), and JavaScript for the logic and rendering on an HTML Canvas.
- Host: GitHub
- URL: https://github.com/burnycoder/bird-flocking
- Owner: BurnyCoder
- Created: 2025-04-15T16:10:32.000Z (about 1 year ago)
- Default Branch: main
- Last Pushed: 2025-04-15T16:13:37.000Z (about 1 year ago)
- Last Synced: 2025-10-31T09:51:28.913Z (8 months ago)
- Language: HTML
- Homepage:
- Size: 9.77 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
# Bird flocking
Browser-based simulation demonstrating emergent flocking behavior, referred to as "boids", with group of agents (birds) following a set of simple rules, resulting in complex, life-like flock movement patterns, using HTML, CSS (with Tailwind CSS for styling), and JavaScript for the logic and rendering on an HTML Canvas.

## How to run
Open bird-flocking.html
## Mechanisms
1. **Separation:** Steer to avoid crowding local flockmates. Birds calculate a repulsive force away from neighbors that are within the `avoidanceRadius`. The closer a neighbor, the stronger the repulsive force.
2. **Alignment:** Steer towards the average heading (velocity) of local flockmates. Birds try to match the direction of their neighbors.
3. **Cohesion:** Steer to move toward the average position (center of mass) of local flockmates. Birds try to stay close to the group.