//Joshua Jack Midterm Takehome// String title = "Midterm"; String author= "Joshua Jack"; String instructions= "q to quit;, r to reset, ? for help"; //// Global Declarations//// int boatCounter=10; float boatXD= 40; float boatDraw; float day; float surface; float sunX, sunY, sunXD=10; float boatX, boatY; void setup () { //// setup,size,reset,etc. size( 600,400 ); surface = height/3; sunY= surface/1; frameRate(10); } //boat, controls what side/angle it will appear void reset () { if (random(20) >3) { boatX= width-20; boatY=4; } } //Commands for the Keys (on Keyboard Q>>Exits and R>>Resets// void keyPressed() { if ( key =='q') exit(); if ( key =='r') reset(); } void draw() { scene(); // the transition of the sky and mov. of sun// boat(); // Moving boat// action();// THis pieace moves the boat// octopus(); // circular in nature// messages(); // Messages include My name and "Midterm"// } void messages() { text( title, width/3, 20 ); text( author, 21,height-15 ); // my name etc as stated above// } void scene() { // The Sun and sky with ocean// background( 125,206,250 ); fill(253,184,19); ellipse(sunX,sunY,60,60 ); fill( 100,100,255 ); rect(0, surface, width, height ); sunX= sunX+15; sunX= sunX % width; } void action() { // boat moves// boatX += boatXD; if(boatX > width || boatX<0) boatXD= -boatXD; } // the boat could not make it look like an actual boat tried and failed// void boat() { rect( boatX+100,boatY+110,boatXD,90 ); fill( 165,42,42); } void octopus() { // octopus (sortoff)// float octX,octY; octX = width/2; octY = height*2/4; octY = octY - sunX; ellipseMode(CENTER); ellipse(octX, octY, 20,45); }