Flocking in 2D
21 Dec 2011
The implementation of the flocking behaviour is taken from this website.

There are only four rules...

1. Objects try to fly towards the centre of mass of neighbouring boids
2. Objects try to keep a small distance away from other objects
3. Objects try to match velocity with near Objects.
4. Objects try to stay within the bounds of the canvas.
Sorry, your browser does not support Canvas.
1. flocking.js - Download, index.html
//Code goes here

Javascript Demos

Here's a bunch of javascript... things I wrote over the years whenever time permitted.