Watch and enjoy You may need to turn on turbo mode (SHIFT + green flag) if you experience lag. You can also lower the "numBoids" variable in the "reset" block, which is located on the very left. (40 is default)
All of this is heavily inspired by a simulation Craig Reynolds made a while ago: http://www.red3d.com/cwr/boids/ ---Patch notes--- v_1.0.0 OFFICIAL RELEASE - I finally managed to get everything right. I fixed a glitch that the boids would prefer moving down over anything else, I tweaked the strength with which they are repelled from the edge, and also fixed some more wrong variables that were casing the boids to have an infinitely large field of view (even though in reality they can only see a certain distance) v_0.4.2 I realized that i was using wrong variables all over the place and that every boid was only able to interact with itsself, and not with others. That is now fixed, but it's still not perfect. Fps could be better, too v_0.4.1 After programming the 3 behaviors (alignment, cohesion and seperation), it kinda works, though not as expected v_0.4.0 Programmed the basic structure of the boid's interactions. It doesn't do anything yet, but tomorrow I can immediately start programming that v_0.3.3 After a bit of trial and error, I got the orientation to work as well v_0.3.2 Positions seem to behave well now, just the orientation is a bit off v_0.3.1 At this point, I expected the movement to work properly, but it didn't quite look right v_0.3.0 Started on the movement code by adding an exp function v_0.2.1 Rendering isn't slow anymore v_0.2.0 Added rendering, though it's kinda slow..., bg is now black v_0.1.1 Programmed the reset function v_0.1.0 I used vector graphics for the first time ever and created the creature. Also grey bg v_0.0 Empty project