/boids

Flocking simulator written in Rust, using the Nannou framework.

Primary LanguageRustGNU General Public License v3.0GPL-3.0

Boids 🕊

boids is a flocking simulator written in Rust, using the Nannou framework.


flock

Features 🐤

  • Modeled after Craig Reynold's Boids algorithm, follows three simple steering behaviours
    • Alignment - Steer towards the average direction of local flockmates.
    • Cohesion - Steer towards direction of average position of nearby flockmates.
    • Separation- Steer away from flockmates that are too close to avoid crowding.
  • 🐣 Adjustable number of boids, from 100-1000.
  • 🦅 Predator boid that "hunts" the prey boids.
  • 🖼️ Themes!

Building / Getting Started ⚙️

Prerequisites

MacOS/Linux

  • To download and run the program, execute the following commands in your terminal.
git clone https://github.com/postfen/boids.git
cd boids
cargo build --release
cd target/release
open .
./boids

Windows

  • To download and run the program, execute the following commands in Powershell.
  • Note - Please let me know if this works. I don't have a Windows machine to test it, currently.
git clone https://github.com/postfen/boids.git
cd boids
cargo build --release
cd target/release
start .
.\boids

To run again, just find the compiled boids executable (default location is boids/target/release), and run the program by double clicking on it.

Controls ⌨️

Modifier Keys
Alignment u/i
Cohesion j/k
Separation m/,
Add/Remove Boids Up/Down
Add/Remove Predators Right/Left
Change Theme t
Hide Menu h