int n; //# of fish float x, y; //position float w , h; //fish size float horizon=100; float wX; String myName = "Adam Kochen"; String gName = "Fish"; float fishX,fishM=5; void setup () { size(800,600); //reset(); } void draw() { noStroke(); background(200,250,255); //sky fill(0,0,255); rect(0,horizon,width,height); //water //0-0 x = 600; //0-0 y = 300; //0-0 if(x-60*n < width){ //0-0 } n=1; x=50; y=300; //y = y-random(1,5)+random(1,5); w= 25; h= 15; fishX=fishX+fishM; fish(fishX,y,w,h); if(fishX > width || fishX < 0){ fishM = -fishM; }; wX=wX-4; fill(200,250,255); //-- fill(255,0,0); waves(wX,horizon,80,60); //moving waves //-- fill(0); waves(0,horizon,80,60); //still waves //test text fill(0); text("fishM "+fishM,10,10); text("fishX "+fishX,10,20); text("y "+y,10,30); text("w "+w,10,40); text("h "+h,10,50); text(myName + " - " + gName,300,10); } void fish(float x,float y,float w,float h ) { float tailX=w; //draw lead bird triangle ellipseMode(CENTER);//body fill(255); ellipse(x,y,w,h); //rect(x,y,10,10); triangle(x-tailX/2+5,y,tailX,y-h/1.5,tailX,y+h/1.5); //tail if(fishX > width || fishX < 0){tailX=-tailX;} } void wave(float wx, float wy, float ww, float wh){ //-- fill(200,250,255); ellipse(wx,wy,ww,wh); //wave ellipse if(wx == 0) {wx = width;} } void waves(float wX, float wY, float wW, float wH){ float horizonY = horizon; float xx = wX; //-- for( int l = 0; l < 800;l=l+7) for( xx=wX; xx