//Valondine Jeudy //October 15, 2014 //CST 112 //Prof. M //In class exercises float fishX, fishY, fishW, fishH; float x,y,w,h; int n; //number of fishs float sunX = 100, sunY = 100; float horizon; float waveX, waveY, waveW=35; void setup() { //setup size(800, 600); frameRate(30); horizon = height/4; waveY = horizon; } void draw() { //next frame scene(); waves(); fish(); waveX = (waveX+1) % waveW; } void scene() { // sky, sea, waves //blue sky fill(135, 206, 250); background (0, 55, 255); //green rectMode(CORNER); rect(0, 0, width, horizon); //sun fill(255, 255, 0); ellipse(sunX-60,sunY-45,60,60); sunX= sunX + 1.2; if(sunX>=width){ sunX = 0; sunY = sunY; } //title stroke(0); textSize(20); text( "Fish", width/2, horizon*1/4 ); textSize(15); text( "Valondine Jeudy", 20, height-20 ); } void waves( ){ //draw waves fill(135, 206, 250); ellipseMode(CENTER); noStroke(); float xx= waveX; for ( xx= waveX-waveW; xx<=width+waveW; xx+=waveW ) { ellipse( xx,waveY, waveW, waveW ); xx+= waveW; //make the wave appear } } void fish(){ }