//consider giving different boids different maxspeeds and maxforces FlockSystem fs; Renderer myRenderer; boolean init = false; float tx, ty, tz; float rx, ry, rz; void setup() { size(300,300); colorMode(RGB,255,255,255,100); fs = new FlockSystem(); myRenderer = new Renderer(); for(int i = 0; i < 5; i++ ) { fs.addBoid(new TailBoid()); } for(int i = 0; i < 5; i++ ) { fs.addBoid(new RichBoid()); } /* for(int i = 0; i < 5; i++ ) { fs.addBoid(new GeraldineBoid(color(random(0, 255), random(0, 255), random(0, 255)))); } for(int i = 0; i < 5; i++) { fs.addBoid(new Jane2Boid()); } for(int i = 0; i < 5; i++) { fs.addBoid(new KBoid()); } for(int i = 0; i < 5; i++) { fs.addBoid(new DaveMBoid()); } */ println("added boids"); tx = 0.0; ty = 0.0; tz = 0.0; smooth(); } void draw() { background(0); translate(tx, ty, tz); fs.run(); } void keyPressed() { char tkey = key; if(key == 'c') { tx = 0.0; ty = 0.0; tz = 0.0; rx = 0.0; ry = 0.0; rz = 0.0; } if(key == 's') { tz-=15.0; } if(key == 'w') { tz+=15.0; } if(key == 'a') { ry+=PI/8; } if(key == 'd') { ry-=PI/8; } }