Fish[] fish = new Fish [6]; void setup() { size(640,480); smooth(); for (int i = 0; i < fish.length; i++) { fish[i] = new Fish (color (i*2), 0, i/20.0); } } void draw (){ background (0); for (int i = 0; i < fish.length; i++) { fish[i].move(); fish[i].display(); } } class Fish { float xpos; float ypos; float xspeed; Fish (float xpos_, float ypos_, float xspeed_) { xpos = 300 + 1; ypos = 300 + 1; xspeed = xspeed_; } void display() { smooth(); rectMode (CENTER); fill (200,0,0); ellipse (xpos, ypos, 70,40); fill (0); ellipse (xpos-11,ypos-9, 10,15); fill (200,0,0); rect (xpos+38,ypos,8,40); //tried to do another for loop for sonar, //but ended up with a while loop (whoops) int i = 0; while (i < width) { noStroke(); float distance = abs (mouseX - i); fill(200,0,0 + distance); rect(i,0,10, height); i += 10; } } void move() { xpos = xpos + xspeed*5; if (0 > width) { xpos = 0; } } }