String title = "Race the squids, Winner gets a red circle"; String author = "Alex Dahlgren, CST 112 Final"; float surface, bottom, buttonX, buttonY, sideX, sideY; int many = 7; int win =-1; int count = 0; Boolean gameEnd = false; String names[] = {"A", "B", "C", "D", "H", "I", "J"}; Squid giant[] = new Squid[7]; Boolean day = true; float sunX = 0; float sunY = 40; void setup() { size (600,600); if(sunX > width) day = !day; surface = height/4; bottom= height-100; sideX= width*3/4; sideY= surface+50; buttonX= width/4; buttonY= surface-90; reset(); } void reset() { win = -1; float x = 100; many = int(random(2,7)); for (int a = 0; a width) {day=!day;} } gameEnd = false; day = true; } void button() { fill(0); text("Go", buttonX,buttonY); fill(250,0,0); rect(buttonX, buttonY, 30,30); if (mousePressed) { if(dist(mouseX,mouseY,buttonX,buttonY) <50) { race(); } } } void draw() { background( 0, 150, 250 ); fill( 0, 250, 40 ); rectMode(CORNER); rect( 0, surface, width, height*3/4 ); // Text on screen fill(0); textSize(12); text( title, width/3, 50 ); text (author, width/3 , 90); text( "Creatures race whenever SpaceBar is pressed or Go button is clicked", width/3, 70 ); button(); if(sunX > width){ day = false;} sun(); fill( 255,0,255 ); show( giant, many ); for(int i = 0; i width) { sunX = 0; } if(sunX > width) { day = !day; } if(day = true) { sunX += 5; fill(210,214,32); ellipse(sunX,sunY,30,30); } if(day = false) { sunX +=5; fill(115,115,115); ellipse(sunX, sunY, 30,30); } } void keyPressed() { if (key == 'q') exit(); if (key == 'r') reset(); if (key == ' ') race(); } void race() { if(!gameEnd) { for(int m = 0; m