An implementation of boids built with C++ and raylib. This is inspired by my previous boids project made with javascript and html canvas.
To allow myself to focus more on getting familiar with C++ and the raylib library, I used V. Hunter Adams's algorithm for a guide. On top of the usual simulation I added some interactivity similar to my javascript implementation, I've added:
- Boids are attracted to your mouse's position when moving towards it, once a boid is moving away from the mouse it ignores it.
- By left clicking you can add an interactive point, boids will treat this point similarly to the mouse.
-
You can remove the last point added by pressing
Z
on your keyboard.
You can see examples of the boids interacting with the mouse and a point in the video above.