mirror of
https://github.com/processing/processing4.git
synced 2026-02-14 10:55:38 +01:00
Removing Topics from SVN
This commit is contained in:
@@ -1,32 +0,0 @@
|
||||
/**
|
||||
* Flocking
|
||||
* by Daniel Shiffman.
|
||||
*
|
||||
* An implementation of Craig Reynold's Boids program to simulate
|
||||
* the flocking behavior of birds. Each boid steers itself based on
|
||||
* rules of avoidance, alignment, and coherence.
|
||||
*
|
||||
* Click the mouse to add a new boid.
|
||||
*/
|
||||
|
||||
Flock flock;
|
||||
|
||||
void setup() {
|
||||
size(640, 360);
|
||||
flock = new Flock();
|
||||
// Add an initial set of boids into the system
|
||||
for (int i = 0; i < 150; i++) {
|
||||
flock.addBoid(new Boid(new PVector(width/2,height/2), 3.0, 0.05));
|
||||
}
|
||||
smooth();
|
||||
}
|
||||
|
||||
void draw() {
|
||||
background(50);
|
||||
flock.run();
|
||||
}
|
||||
|
||||
// Add a new boid into the System
|
||||
void mousePressed() {
|
||||
flock.addBoid(new Boid(new PVector(mouseX,mouseY),2.0f,0.05f));
|
||||
}
|
||||
Reference in New Issue
Block a user