PImage background; float y = 0; float scroll = width; void setup() { size(768, 576); // Size should be the first statement background(40,0,0); // Set the background to dark red (0 is black) stroke(255); // Set stroke color to white noLoop(); //add in to stop thing looping, add mousePressed() to switch looping on smooth(); //antialiasing for the vector graphics background = loadImage("nanotexture_pal.gif"); //flock colorMode(RGB,255,255,255,100); flock = new Flock(); flockCell = new FlockCell(); flockBod = new FlockBod(); // Add an initial set of boids into the system, with their starting point related to width and height for (int i = 0; i < 30; i++) { flock.addBoid(new Boid(new Vector3D(0,0),2.0f,0.05f)); //width-200,height/1.5 } // Add an initial set of boids2 into the system for (int j = 0; j < 12; j++) { flockCell.addBoid2(new Boid2(new Vector3Dcell(width/4,height-100),0.5f,0.1f)); } // Add an initial set of boids3 into the system for (int k = 0; k < 5; k++) { flockBod.addBoid3(new Boid3(new Vector3Dbod(width/0.2,height/0.2),0.3f, 0.01f)); } } void draw() { // background(40,0,0); // Set the background to dark red (0 is black) image(background, scroll, 0); // print (scroll); scroll = scroll - 1; //change for speed of scroll if (scroll < -1733) { //width of image - width of screen //scroll = 768; println(scroll); image(background, scroll+2500, 0); if (scroll < -2500) { scroll = scroll+2500; } } flock.run(); flockCell.run(); flockBod.run(); } void mousePressed() { loop(); flockBod.addBoid3(new Boid3(new Vector3Dbod(mouseX,mouseY), 0.3f,0.01f)); } /* /// the vertical line scroll line(y, 0, y, height); y = y - 4; // change for speed if (y < 0) { y = width; } */ // draw_cell(360, 270, 100, 5); // draw_target(68, 434, 80, 3); /* void draw_target(int xloc, int yloc, int size, int num) { strokeWeight(1); stroke(204); float grayvalues = 255/num; float steps = size/num; for(int i=0; i