/*there is a bug in the program that won't let me
go directly from the growth to the caterpillar. Sigh.
*/
//declare images
PImage enter;
PImage eatmedrinkme;
PImage grow;
PImage caterpillar;
PImage cheshirecat;
PImage madhatter;
PImage paintingtherosesred;
PImage end;
//declare page
int page = 1;
//declare boolean variables
boolean over1 = false;
boolean over2 = false;
boolean over3 = false;
boolean over5 = false;
boolean over6 = false;
boolean over7 = false;
boolean over8 = false;
boolean over9 = false;
boolean over10 = false;
boolean over11 = false;
boolean over12 = false;
boolean over13 = false;
void setup() {
size(600, 400);
enter=loadImage ("enter.png");
eatmedrinkme = loadImage ("eatmedrinkme.png");
grow= loadImage ("grow.png");
caterpillar = loadImage ("caterpillar.png");
cheshirecat = loadImage ("cheshirecat.png");
madhatter= loadImage ("Madhatter.png");
paintingtherosesred= loadImage ("paintingtherosesred.png");
end=loadImage ("end.png");
}
void draw() {
if (page == 1) {
image (enter, 0, 0);
}
else if (page == 2) {
image (eatmedrinkme, 0, 0);
}
else if (page == 3) {
image (grow, 0, 0);
}
else if (page == 4) {
image (caterpillar, 0, 0);
}
else if (page == 5){
image (cheshirecat, 0, 0);
}
else if (page==8){
image (end, 0, 0);
}
else if (page==6){
image (madhatter, 0, 0);
}
else if (page==7){
image (paintingtherosesred, 0, 0);
noStroke();
if (over1 == true) {
fill(180, 0, 0, 170);
}
else {
noFill();
}
ellipse (152, 151, 43, 42);
if (over2 == true) {
fill(180, 0, 0, 170);
}
else {
noFill();
}
ellipse (193, 79, 25, 24);
if (over3 == true){
fill(180, 0, 0, 170);
}
else{
noFill();
}
ellipse (229, 129, 25, 23);
if (over5 ==true){
fill(180, 0, 0, 170);
}
else{
noFill();
}
ellipse (245, 55, 23, 36);
if (over6 == true) {
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (283, 110, 28, 36);
if (over7 == true) {
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (299, 185, 33, 28);
if (over8==true) {
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (293, 60, 24, 24);
if (over9== true){
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (336, 129, 26, 24);
if (over10==true){
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (373, 196, 26, 24);
if (over11==true){
fill(180, 0, 0, 170);
}
else{
noFill();
}
ellipse (361, 61, 26, 24);
if (over12==true){
fill(180, 0, 0, 170);
}
else{
noFill();
}
ellipse (397, 105, 40, 38);
if (over13== true){
fill (180, 0, 0, 170);
}
else{
noFill();
}
ellipse (421, 176, 28, 35);
if (over1==true && over2==true && over3==true && over5==true
&& over6==true && over7==true && over7==true && over8 ==true && over9==true
&& over10==true && over11==true && over12==true && over13==true)
image (end, 0, 0);
}
}
void mousePressed() {
if (page == 1) {
if ((mouseX > 185) && (mouseX < 377) && (mouseY > 187) && (mouseY < 370)) {
page = 2;
}
}
if (page==2){
if ((mouseX > 297) && (mouseX < 591) && (mouseY > 20) && (mouseY < 360)) {
page = 3;
}
if ((mouseX>0) && (mouseX < 230) && (mouseY > 20) && (mouseY <360)){
page = 4;
}
}
if (page==3){
if ((mouseX >429) && (mouseX<580) && (mouseY >317) && (mouseY<379)){
page =4;
}
}
if (page==4){
if ((mouseX>411) && (mouseX<563) && (mouseY >304) && (mouseY<397)){
page=5;
}
}
if (page==5){
if ((mouseX>11) && (mouseX<148) && (mouseY > 168) && (mouseY<274)){
page=6;
}
if ((mouseX>433) && (mouseX<570) && (mouseY > 172) && (mouseY<272)){
page=7;
}
}
if (page==6)
if ((mouseX>221) && (mouseX<570) && (mouseY>57)&& (mouseY<183)){
page=7;
}
if (page==7){
if (mouseX > 131 && mouseX < 170 && mouseY > 132 && mouseY < 172) {
over1 = true;
}
if (mouseX>181 && mouseX <205 && mouseY>69 && mouseY <92){
over2=true;
}
if (mouseX>216 && mouseX<238 && mouseY>118 && mouseY<143){
over3=true;
}
if (mouseX>233 && mouseX< 258 && mouseY>42 && mouseY<69){
over5=true;
}
if (mouseX>270 && mouseX<297 && mouseY>93 && mouseY<128){
over6=true;
}
if (mouseX>283 && mouseX<314 && mouseY>173 && mouseY< 201){
over7=true;
}
if (mouseX>282 && mouseX<306 && mouseY>49 && mouseY<74){
over8=true;
}
if (mouseX>325 && mouseX<348 && mouseY>119 && mouseY<144){
over9=true;
}
if (mouseX>362 && mouseX<389 && mouseY>183 && mouseY<209){
over10=true;
}
if (mouseX>350 && mouseX<370 && mouseY>48 && mouseY<72){
over11=true;
}
if (mouseX>379 && mouseX<419 && mouseY>89 && mouseY<128){
over12=true;
}
if (mouseX>407 && mouseX<436 && mouseY>165 && mouseY<193){
over13=true;
}
}
}
Danna - Project 1
on Tuesday, Oct 28, 2008 – 9:34 pm
One Comment
so creative! the images are awesome!