Boids demo 01

This browser does not have a Java Plug-in.
Get the latest Java Plug-in here.

Wave the mouse around in the applet above. The boids will flock towards the mouse. This code extends my Physics code with some pseudo code I found based on the old Reynolds stuff. The basic stuff above implements centering the boids, avoiding neighbours, common direction and individual goal. Note that without the individual goal they kinda do this Star Trek next gen title sequence thing of just suddenly warping out of this universe - gotta have a goal - that's AI for you.

References: Boids Pseudocode, Craig W. Reynolds, flight404 flocking, Shiffman's Swarm

Source code: boids_test_01 Boid BoidFlock Line Particle Physics Point Spring

Built with Processing