//x and y of stage int stageX = 668; int stageY = 300; // x and y of life position float x1 =random(386); float y1 =0; //x and y of life box float expand1X = 127; float expand1Y = 14; //x and y of miss of position float x2 = 0; float y2 = random(300); //x and y of miss box float expand2X = 98; float expand2Y = 14; String life ="life moves pretty fast"; String missing = "you're missing it"; //tells you what frame you are on int count = 21; int mcount= 26; //if mouse is over the boxes... boolean miss_touched = false; void setup(){ size(stageX, stageY); //window size framerate(30); fill(0, 0, 0, 50); noStroke(); } void draw(){ background(255); PFont font; font = loadFont("Geneva-48.vlw"); textFont(font, 12); count=count+1; mcount = mcount + 1; //if true than blue, if false, than grey (life) if(miss_touched == true) { fill(66,134,204); } else { fill(150); } ///////////////THIS IS THE LIFE DRAWING AREA////o/////////////////////////////////////////////////////////////// //if mouse falls within life box, life pauses AM I INSIDE THE BOX? if(mousePressed){ if (mouseX >= x1 && mouseX <= x1+expand1X && mouseY >= y1-41 && mouseY <= y1+ expand1Y) { count=0; Stop(); Lcouldmiss(); } else { lifemoves(); } } else { lifemoves(); } Stop(); float lifewidth =textWidth(life); //THIS IS THE MISS DRAWING //if mouse falls within miss box, miss pauses if(mousePressed){ if (mouseX >= x2 && mouseX <= x2 + expand2X && mouseY >= y2 && mouseY <= y2 + expand2Y ) { mcount = 0; missingcount(); if (mcount <= 12) {expand1X = 0; }else { expand1X = 127; } } else{ misscount(); life ="life moves pretty fast"; } }else { misscount(); life ="life moves pretty fast"; } missingcount(); if (mcount <= 12) {expand1X = 0; miss_touched = true; }else { expand1X = 127; } //brings it back around if (y1 >= stageY) { y1 = 0; x1 = random(386); } if (x1 >= stageX && y1>=stageY) { x1 =random(386); } if (y2 >= stageY) { y2 = random(300); } if (x2 >= stageX) { x2 = 0; y2 =random(300); } textWidth(missing); textWidth(life); textWidth("if you don't stop and look around once in a while"); textWidth("you could miss it"); } void lifemoves(){ if(count>20){ textAlign(LEFT); text(life, x1, y1, expand1X, expand1Y); y1 += 20; fill(150); } } void Stop(){ if (count<=20){ text("if you don't stop and look around once in a while", x1, y1, expand1X+150, expand1Y); fill(66,134,204); } } //make miss blue void Lcouldmiss(){ miss_touched = false; text("you could miss it", x2, y2, expand2X, expand2Y); } void missingcount(){ if(mcount<=25){ text(missing, x2, y2, expand2X, expand2Y);} fill(150); } void misscount(){ if(mcount>25){ text("you could miss it", x2, y2, expand2X, expand2Y); x2 = x2+40; fill(150); expand1X = 127 ; expand1Y= 14; miss_touched = false; } }