// Project 3 //professor Martin //Hugo Bonilla //CST 112 int n; float horizon; float x= 100; float y= 350; float h= 10; float w= 15; float wavesX= -100; float wavesY = horizon; float pairs = random (3,7); float fishdirectionX = 2; boolean negfdx = false; void setup(){ size(500,600); horizon= height/4; reset(); } void draw() { scene(); fishg ( n, x ,y ,w ,h); // title textSize(17); fill(0); text( "WAVES", width/2.5, 30); textSize(15); text(" Hugo Bonilla", 20, height-20); //if ( wavesX > width+50) { //wavesX= + 50; //} waves(); //move fish x+= fishdirectionX; if (x > width){ fishdirectionX = -fishdirectionX ; negfdx =true; } } void scene(){ //sky background(118,217,255); fill(36,161,209); //Horizon rectMode(CORNER); rect(0,horizon, width, height*3); } void waves(){ // draw wave noStroke(); fill(118,217,255); ellipseMode(CENTER); //ellipse(wavesX, horizon,50, 30); // make wave loop for ( float x= wavesX; x < width+30 ; x= x +75) { noStroke(); ellipse( x , horizon, 75,40); wavesX+=1; if ( wavesX > 50 ){ wavesX= -100; wavesX+=1; } stroke(1); } } // first fish void fish(float x, float y, float w, float h) { fill(188,219,20); ellipse(x, y , w,h); } // school of fish void fishg (int n, float x, float y, float w, float h){ float xx= x; float up =0; float ww=w; float dy = h/3; float yy= y; dy= h/3; dy += h/3; //first fish fish ( xx ,y ,w,h); // make school of fish for (int j=0;j