//Adrian Ortega //Creative Computing //Pudt 1203 //Justin Braske //I Spy PImage next, cover, wordDesk, desk, ladybug1, ladybug2, ladybug3, ladybug4, ladybug5, ladybug6, holepuncher1, holepuncher2, heart1, heart2, heart3, colorpencil, blacksharpie, ruler, penny, scissors, sharpener, kitchen, wordkitchen, teacup, wateringcan, plate1, plate2, plate3, plate4, plate5, plate6, plate7, plate8, clock, lightswitch, wineglass, streets, bus, classroom, wordclassroom, letterO1, letterO2, greencrayola1, greencrayola2, globe, kiddypool, americanFlag, watertank, greensweater, endPage; //these are checking to see which page is being shown currently boolean p1; //cover page boolean p2; //desk page boolean p3; //kitchen page boolean p4; //bus page boolean p5; //classroom page boolean p6; //end page //which page we are currently on (starts at page 1) int page = 1; //stores xPosition for the bus so it can slide across the screen int busPosX = 0; void setup() { size (700, 600); background(255); next = loadImage("next-7.png"); cover = loadImage("cover.png"); //////////desk desk = loadImage("desk.png"); wordDesk = loadImage("worddesk.png"); ladybug1 = loadImage("ladybug1.png"); ladybug2 = loadImage("ladybug2.png"); ladybug3 = loadImage("ladybug3.png"); ladybug4 = loadImage("ladybug4.png"); ladybug5 = loadImage("ladybug5.png"); ladybug6 = loadImage("ladybug6.png"); holepuncher1 = loadImage("holepuncher1.png"); holepuncher2 = loadImage("holepuncher2.png"); heart1 = loadImage("heart1.png"); heart2 = loadImage("heart2.png"); heart3 = loadImage("heart3.png"); colorpencil = loadImage("colorpencil.png"); blacksharpie = loadImage("blacksharpie.png"); ruler = loadImage("ruler.png"); penny = loadImage("penny.png"); scissors = loadImage("scissors.png"); sharpener = loadImage("sharpener.png"); //////////kitchen kitchen = loadImage("kitchen.png"); wordkitchen = loadImage("wordkitchen.png"); teacup = loadImage("Teacup.png"); wateringcan = loadImage("wateringcan.png"); plate1 = loadImage("plate1.png"); plate2 = loadImage("plate2.png"); plate3 = loadImage("plate3.png"); plate4 = loadImage("plate4.png"); plate5 = loadImage("plate5.png"); plate6 = loadImage("plate6.png"); plate7 = loadImage("plate7.png"); plate8 = loadImage("plate8.png"); clock = loadImage("clock.png"); lightswitch = loadImage("lightswitch.png"); wineglass = loadImage("wineglass.png"); //////////bus streets = loadImage("streets.png"); bus = loadImage("bus.png"); //////////classroom classroom = loadImage("classroom.png"); wordclassroom = loadImage("wordclassroom.png"); letterO1 = loadImage("1LetterO.png"); letterO2 = loadImage("2LetterO.png"); greencrayola1 = loadImage("greencrayola1.png"); greencrayola2 = loadImage("greencrayola2.png"); globe = loadImage("globe.png"); kiddypool = loadImage("kiddypool.png"); americanFlag = loadImage("Americanflag.png"); watertank = loadImage("watercan.png"); greensweater = loadImage("greensweater.png"); //////////end endPage = loadImage("finalGreat.png"); } void draw() { switch(page) { case 1: //cover fill(255); image(cover, 0, 0); p1 = true; //cover page p2 = false; //desk page p3 = false; //kitchen page p4 = false; //bus page p5 = false; //classroom page p6 = false; //end page break; case 2: //desk fill(255); image(next, 0, 0); p1 = false; //cover page p2 = true; //desk page p3 = false; //kitchen page p4 = false; //bus page p5 = false; //classroom page p6 = false; //end page break; case 3: //kitchen fill(255); image(next, 0, 0); p1 = false; //cover page p2 = false; //desk page p3 = true; //kitchen page p4 = false; //bus page p5 = false; //classroom page p6 = false; //end page break; case 4: //bus fill(255); image(streets, 0, 0); image(bus, busPosX, 0); busPosX+=2; //moves bus over 2 px per frame if (busPosX >= width) { busPosX = width; image(next, 0, 0); } p1 = false; //cover page p2 = false; //desk page p3 = false; //kitchen page p4 = true; //bus page p5 = false; //classroom page p6 = false; //end page break; case 5: //classroom fill(255); image(next, 0, 0); p1 = false; //cover page p2 = false; //desk page p3 = false; //kitchen page p4 = false; //bus page p5 = true; //classroom page p6 = false; //end page break; case 6: //end fill(255); image(endPage, 0, 0); p1 = false; //cover page p2 = false; //desk page p3 = false; //kitchen page p4 = false; //bus page p5 = false; //classroom page p6 = true; //end page break; } } void mouseReleased() { //////Cover //// // // if (p1) { //If next button is pressed while on cover if (mouseX > 315 && mouseX <380 && mouseY > 200 && mouseY < 400) { image(desk, 0, 0); //draw desk page image(wordDesk, 0, 75); //draw desk list page = 2; } } //////Desk //// // // if (p2) { if (mouseX > 360 && mouseX <380 && mouseY > 324 && mouseY < 335) { image(ladybug1, 0, 0); } //ladybug2 if (mouseX > 310 && mouseX <326 && mouseY > 409 && mouseY < 429) { image(ladybug2, 0, 0); } //ladybug3 if (mouseX > 140 && mouseX <170 && mouseY > 370 && mouseY < 390) { image(ladybug3, 0, 0); } //ladybug4 if (mouseX > 190 && mouseX <210 && mouseY > 220 && mouseY < 230) { image(ladybug4, 0, 0); } //ladybug5 if (mouseX > 440 && mouseX <450 && mouseY > 88 && mouseY < 100) { image(ladybug5, 0, 0); } //ladybug6 if (mouseX > 570 && mouseX <590 && mouseY > 325 && mouseY < 336) { image(ladybug6, 0, 0); } //holepuncher1 if (mouseX > 215 && mouseX <260 && mouseY > 75 && mouseY < 105) { image(holepuncher1, 0, 0); } //holepuncher2 if (mouseX > 290 && mouseX <310 && mouseY > 25 && mouseY < 60) { image(holepuncher2, 0, 0); } //colorpencil if (mouseX > 255 && mouseX <265 && mouseY > 120 && mouseY < 175) { image(colorpencil, 0, 0); } //heart1 if (mouseX > 345 && mouseX <360 && mouseY > 30 && mouseY < 40) { image(heart1, 0, 0); } //heart2 if (mouseX > 460 && mouseX <470 && mouseY > 220 && mouseY < 230) { image(heart2, 0, 0); } //heart3 if (mouseX > 470 && mouseX <480 && mouseY > 240 && mouseY < 245) { image(heart3, 0, 0); } //blacksharpie if (mouseX > 532 && mouseX <540 && mouseY > 198 && mouseY < 218) { image(blacksharpie, 0, 0); } //scissors if (mouseX > 430 && mouseX <510 && mouseY > 370 && mouseY < 465) { image(scissors, 0, 0); } //penny if (mouseX > 535 && mouseX <550 && mouseY > 491 && mouseY < 505) { image(scissors, 0, 0); } //sharpener if (mouseX > 502 && mouseX <513 && mouseY > 160 && mouseY < 169) { image(sharpener, 0, 0); } //ruler (4 parts because it's an irregular parallelagram) if (mouseX > 480 && mouseX <520 && mouseY > 265 && mouseY < 170) { image(ruler, 0, 0); } if (mouseX > 500 && mouseX <535 && mouseY > 300 && mouseY < 320) { image(ruler, 0, 0); } if (mouseX > 510 && mouseX <550 && mouseY > 340 && mouseY < 360) { image(ruler, 0, 0); } if (mouseX > 515 && mouseX <560 && mouseY > 355 && mouseY < 440) { image(ruler, 0, 0); } //If next button pressed while on desk if (mouseX > 575 && mouseX 400 && mouseY < 470) { page = 3; fill(255); rect(0, 500, width, 200); image(kitchen, 0, 0); image(wordkitchen, 0, 75); } } //////Kitchen //// // // if (p3) { if (mouseX > 660 && mouseX <680 && mouseY > 122 && mouseY < 150) { image(teacup, 0, 0); } if (mouseX > 260 && mouseX <284 && mouseY > 434 && mouseY < 474) { image(wateringcan, 0, 0); } if (mouseX > 2 && mouseX <42 && mouseY > 2 && mouseY < 32) { image(plate1, 0, 0); } if (mouseX > 484 && mouseX <501 && mouseY > 148 && mouseY < 168) { image(plate2, 0, 0); } if (mouseX > 520 && mouseX <540 && mouseY > 148 && mouseY < 167) { image(plate3, 0, 0); } if (mouseX > 560 && mouseX <580 && mouseY > 150 && mouseY < 168) { image(plate4, 0, 0); } if (mouseX > 400 && mouseX <472 && mouseY > 452 && mouseY < 477) { image(plate5, 0, 0); } if (mouseX > 490 && mouseX <583 && mouseY > 458 && mouseY < 482) { image(plate6, 0, 0); } if (mouseX > 587 && mouseX <610 && mouseY > 423 && mouseY < 446) { image(plate7, 0, 0); } if (mouseX > 17 && mouseX <80 && mouseY > 387 && mouseY < 401) { image(plate8, 0, 0); } if (mouseX > 620 && mouseX <656 && mouseY > 28 && mouseY < 98) { image(clock, 0, 0); } if (mouseX > 692 && mouseX <700 && mouseY > 301 && mouseY < 320) { image(lightswitch, 0, 0); } if (mouseX > 527 && mouseX <550 && mouseY > 413 && mouseY < 441) { image(wineglass, 0, 0); } //if we click the next button while on kitchen if (mouseX > 575 && mouseX 400 && mouseY < 470) { page = 4; } } //////Bus //// // // if (p4) { //If we click the next button while on bus if (mouseX > 575 && mouseX 400 && mouseY < 470) { page = 5; rect(0, 500, width, 200); image(classroom, 0, 0); image(wordclassroom, 0, 75); } } //////Classroom //// // // if (p5) { if (mouseX > 143 && mouseX < 162 && mouseY > 55 && mouseY < 67) { image(letterO1, 0, 0); } if (mouseX > 260 && mouseX <275 && mouseY > 130 && mouseY < 146) { image(letterO2, 0, 0); } if (mouseX > 0 && mouseX < 20 && mouseY > 130 && mouseY < 146) { image(greencrayola1, 0, 0); } if (mouseX > 350 && mouseX < 422 && mouseY > 107 && mouseY < 127) { image(greencrayola2, 0, 0); } if (mouseX > 480 && mouseX < 517 && mouseY > 240 && mouseY < 270) { image(globe, 0, 0); } if (mouseX > 590 && mouseX < 695 && mouseY > 350 && mouseY < 524) { image(kiddypool, 0, 0); } if (mouseX > 430 && mouseX <452 && mouseY > 115 && mouseY <152) { image(americanFlag, 0, 0); } if (mouseX > 0 && mouseX < 20 && mouseY > 471 && mouseY < 521) { image(watertank, 0, 0); } if (mouseX > 230 && mouseX < 328 && mouseY > 497 && mouseY < 522) { image(greensweater, 0, 0); } //If we click the next button while on classroom if (mouseX > 575 && mouseX 400 && mouseY < 470) { page = 6; rect(0, 0, width, height); image(endPage, 0, 0); } } //////END //// // // if (p6) { if (mouseX > 571 && mouseX 682 && mouseY < 453) { page = 1; } } }