// Use a single Boid Boid b; void setup() { // Setup our environment size(600, 400); colorMode(RGB, 255, 255, 255, 100); smooth(); // We'll start our boid in the center of the screen. The parameters // for our boid: // // Vector3D => Starting location // 5.0f => Maximum Boid Speed // 0.1f => Maximum Accerlerating Force b = new Boid(new Vector3D(width / 2, height / 2, 0), 5.0f, 0.1f); } void draw() { // clear the background background(0); // let our boid wander around the screen b.wander(); // run the boid simulation b.simulate(); }