//variables to move the fish int tx, ty; //a function to set up the general drawing parameters void setup() { size(500, 500); background(#00082E); smooth(); tx = -200; ty = -200; frameRate(20); } //press any key to reset the fish void keyPressed() { tx = -200; ty = -200; } //function to draw the fish void drawShip(){ fill(#A2A39F); ellipse(250,250,300,20); arc(250,245,200,200,PI,2*PI); fill(#3CF028); arc(249,230,200,5,0,PI); } //the draw function - which will loop void draw() { background(#00082E); //draw the fish in an updated position using variables pushMatrix(); translate(tx, ty); drawShip(); popMatrix(); //update my variables - either randomly update y or use sin tx = tx +1; //ty = ty + int(random(-5, 5)); ty = -50 + int(30*sin(tx/400.0*6*PI)); }