Flocking simulator, programmed by John Brynte Turesson in 2013.

What's this?

This is a flocking simulator. Each node moves at a constant speed and calculates its direction based on the sorrounding nodes.

What can I do with it?

There are some variables that you can change in the top tool-box and see how the nodes react.

You also have full access to the function that calculates each node's direction.

How do I change the node function?

Changing the node function is as easy as writing JavaScript. The variable this works as a reference to the current node. The function should return a 2D array that represents the direction vector towards which the node should move.

Check the sample code (based on this neat flocking algorithm) to find out more.