• fullscreen
  • Game_1.pde
  • Game_10.pde
  • Game_11.pde
  • Game_2.pde
  • Game_3.pde
  • Game_4.pde
  • Game_5.pde
  • Game_6.pde
  • Game_7.pde
  • Game_8.pde
  • Game_9.pde
  • Lose_Page.pde
  • Title_Page.pde
  • instructions_page.pde
  • mainpage.pde
  • mainpage2.pde
  • wario_ware_game_v6.pde
  • void gameOne(){
      
      win= false;
      background(225); 
    
    if (millis()<currentTime+1000){
      fill (0);
      textSize (24);
      text ("Hit!", 320,220);
      fill (255);
    }
      
      if (millis()>currentTime+1500){
      circleY+=speed2 * direction;
     // println(circleY);
      
      }
     
    
    strokeWeight(0);
      ellipse(circleX, circleY, circleRadius, circleRadius);
     strokeWeight (10); 
      line(lineX1, lineY1, lineX2, lineY2); 
      
      
      if (mouseX>= 130){
        if (mouseX<= 230){
          if (mouseY>=250){
            if (mouseY<=320){
              if (lineX2 <=298.597){
                if (lineY2 >=225){
                if (mousePressed){
    
      lineX2 = offset + cos(angle) * scalar;
      lineY2 = offset+80 + sin(angle) * scalar;
      angle -= speed1;
                
              }
            }
          }
        }
      }
        }
      }
     
     //if (lineX2<=290){
       //if (lineY2>=260){
         //float angle = 30;
         //float speed = 0.0;
       //}
     //}
      
    
      if (circleLineIntersect(lineX1, lineY1, lineX2, lineY2, circleX, circleY, circleRadius) == true) { 
        hit = true;
        fill(0);  
      }  
      else { 
        fill(255); 
      } 
      
      if (hit == true){
        direction = -4;
      }
    
    
      
      if (circleY <- 50){
        fill(0);
        text("WIN", 210, 160);
      }
      
      if (circleY< -350){
        win= true;
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
    
      }
      
      if (circleY>440){
        fill(0);
        text("LOSE",210,160);
       
      }
      
      if (circleY>750){
        lose= true;
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
        
      }
      
    
      
      
    } 
     
    // Code adapted from Paul Bourke: 
    // http://local.wasp.uwa.edu.au/~pbourke/geometry/sphereline/raysphere.c 
    boolean circleLineIntersect(float x1, float y1, float x2, float y2, float cx, float cy, float cr ) { 
      float dx = x2 - x1; 
      float dy = y2 - y1; 
      float a = dx * dx + dy * dy; 
      float b = 2 * (dx * (x1 - cx) + dy * (y1 - cy)); 
      float c = cx * cx + cy * cy; 
      c += x1 * x1 + y1 * y1; 
      c -= 2 * (cx * x1 + cy * y1); 
      c -= cr * cr; 
      float bb4ac = b * b - 4 * a * c; 
     
      //println(bb4ac); 
     
      if (bb4ac < 0) {  // Not intersecting 
        return false; 
      }  
      else { 
         
        float mu = (-b + sqrt( b*b - 4*a*c )) / (2*a); 
        float ix1 = x1 + mu*(dx); 
        float iy1 = y1 + mu*(dy); 
        mu = (-b - sqrt(b*b - 4*a*c )) / (2*a); 
        float ix2 = x1 + mu*(dx); 
        float iy2 = y1 + mu*(dy); 
     
        // The intersection points 
        //ellipse(ix1, iy1, 10, 10); 
        //ellipse(ix2, iy2, 10, 10); 
         
        float testX; 
        float testY; 
        // Figure out which point is closer to the circle 
        if (dist(x1, y1, cx, cy) < dist(x2, y2, cx, cy)) { 
          testX = x2; 
          testY = y2;  
        } else { 
          testX = x1; 
          testY = y1;  
        } 
         
        if (dist(testX, testY, ix1, iy1) < dist(x1, y1, x2, y2) || dist(testX, testY, ix2, iy2) < dist(x1, y1, x2, y2)) { 
          return true; 
        } else { 
          return false; 
        } 
      }
    } 
    
    void gameTen(){  
      lineY10= 255+p10;
      
      println(mouseX);
      println(mouseY);
       win= false;
       background(225); 
      if (millis()<currentTime+1000){
        fill(0);
        textSize(24);
        text("POWER!",100,40);
       }
       
      fill(0);
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
      if ((currentTime+ (3000-t)) - millis()<=3000){
        if ((currentTime+ (3000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (3000-t)) - millis()<=2000){
        if ((currentTime+ (3000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (3000-t)) - millis()<=1000){
        if ((currentTime+ (3000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (3000-t)) - millis()<=0){
        if ((currentTime+ (3000-t)) - millis()>=-10000){
          timer = 0;
        }
      }    
      
      textSize(24); 
       
      strokeWeight(1);
      stroke(0);
      fill(255);
      ellipse(200,230,100,50);
    
      
      if (mouseX>100){
      if (mouseX<300){
        if (mouseY>180){
          if (mouseY<280){
            fill (125);
            }else {
            fill(0);
            }      
          }else {
          fill(0);
          }  
        }else {
        fill(0);
        }  
        }else {
      fill(0);
    }  
    
    if (mousePressed){
      if (mouseX>100){
        if (mouseX<300){
          if (mouseY>180){
            if (mouseY<280){
             if (lineY10>=70){
              fill (125);
              ellipseY10= 230;
              text10= 230;
              p10-= 4-s3;
              
            }     
          } 
        }  
      }
      }
    }else {
      ellipseY10=220;
      text10=220;
    }
      fill(0);
      text ("E", 370,255);
      text ("F",370,90);
      ellipse(200,ellipseY10,100,50);
      fill(255);
      text ("POWER", 155,text10);
     
      strokeCap(SQUARE);
      stroke(255);
      strokeWeight(40);
      line (420,260,420,65);
      strokeWeight(35);
      stroke(0);
      line (420,260,420,lineY10);
      
      if (lineY10 < 75){
        win = true;
      }
      
      if (win == true){
        fill(0);
        text ("WIN", 210,160);
        if (millis()>currentTime+3000){
          page = 0;
          pctmain= 0.0;
          xmain = startXmain;    
          x2main= startX2main; 
          pct2main = 0.0;
          closed = false;
          currentTime= millis();
          w +=1;
          g +=1;
        }
      }
      
      if (millis()> currentTime + (3250-t)){
        if (win == false){
          fill (0);
          text ("LOSE", 320,160);
          lose= true;
          fill (255);
        }
      }
      
      if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
     }
      
      
    
    }
    
    void gameEleven(){
      
       win= false;
       background(225); 
       
       
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
        if ((currentTime+ (6000-t)) - millis()<=6000){
        if ((currentTime+ (6000-t)) - millis()>=5000){
          timer = 6;
        }
      }
      
        if ((currentTime+ (6000-t)) - millis()<=5000){
        if ((currentTime+ (6000-t)) - millis()>=4000){
          timer = 5;
        }
      }
      
      if ((currentTime+ (6000-t)) - millis()<=4000){
        if ((currentTime+ (6000-t)) - millis()>=3000){
          timer = 4;
        }
      }
      
      if ((currentTime+ (6000-t)) - millis()<=3000){
        if ((currentTime+ (6000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (6000-t)) - millis()<=2000){
        if ((currentTime+ (6000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (6000-t)) - millis()<=1000){
        if ((currentTime+ (6000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (6000-t)) - millis()<=0){
        if ((currentTime+ (6000-t)) - millis()>=-10000){
          timer = 0;
        }
      } 
       
      if (circleX11>450) {
        direction11 *= -1;
      }
      
      if (circleX11<30){
        direction11 *= -1;
      }
    
      circleX11+= speed11*direction11;
      
        if (millis()<currentTime+1000){
         fill(0);
         textSize(24);
         text("Bomb!",100,200);
       }
      
      if (trigger211== true){ 
       if (mousePressed== true){
         trigger211= false;
         circleX311= circleX11;
         trigger11= true;
       }
      }
       
       
       if (trigger11== true){
         circleY311+=speed11; 
         ellipse(circleX311, circleY311, circleRadius113,circleRadius113);
       }
       
       
       
       strokeWeight(1);
       ellipse(circleX11, circleY11, circleRadius11,circleRadius11);
       strokeCap(SQUARE);
       strokeWeight(10);
       line (circleX11,circleY11,circleX11,circleY11+25);
       strokeWeight(1);
       rect (rectX11,rectY11,rectWidth11,rectHeight11);
       
       
      if (rectCircleIntersect(rectX11, rectY11, rectWidth11, rectHeight11, circleX311, circleY311, circleRadius113) == true) { 
        fill(255);
        rect (-100,-100,5000,5000);
        rectWidth11= 0;
        rectHeight11= 0;
        circleRadius113=0;
        circleY311=-50;
        speed11= 0;
      }  
      else { 
        fill(0);  
      } 
      
      if (circleRadius113 == 0){
        win = true;
      }
      
      if (win == true){
        textSize(24);
        text ("WIN", 210,160);
          if (millis()>currentTime+3000){
          page = 0;
          pctmain= 0.0;
          xmain = startXmain;    
          x2main= startX2main; 
          pct2main = 0.0;
          closed = false;
          currentTime= millis();
          w +=1;
          g +=1;
        }
      }
      
      if (millis()> currentTime + (6000-t)){
        if (win == false){
          fill (0);
          text ("LOSE", 320,160);
          lose= true;
          fill (255);
        }
      }
      
      if (circleY311>350){
        lose = true;
      }
      
      if (lose == true){
        textSize(24);
        text ("LOSE",210,160);
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
      }
      
    }
    
    void gameTwo(){
      
      
      
    win= false;
    background(225); 
    
      circleX22 = x2; 
      circleY22 = y2; 
      
     if (millis()<currentTime+1000){ 
      fill(0);
      textSize (28);
      text("Move white into black!", 140,40);
     }
     
      fill(0);
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
      if ((currentTime+ (3000-t)) - millis()<=3000){
        if ((currentTime+ (3000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (3000-t)) - millis()<=2000){
        if ((currentTime+ (3000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (3000-t)) - millis()<=1000){
        if ((currentTime+ (3000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (3000-t)) - millis()<=0){
        if ((currentTime+ (3000-t)) - millis()>=-10000){
          timer = 0;
        }
      }      
    
    
      
     fill (0);
     ellipse(circleX12, circleY12, circleRadius12, circleRadius12); 
     fill (255);
      
     if (mouseX<x2+20){
       if (mouseX>x2-20){
         if (mouseY>y2-20){
           if (mouseY<y2+20){
              fill (200);
            }
            else {
              fill (255);
            }
          }
        }
     }
       
    if (circleCircleIntersect(circleX12, circleY12, circleRadius12, circleX22, circleY22, circleRadius22) == true) { 
    fill (0);
    textSize (24);
        text ("WIN", 210,160);
        win = true;
      } 
      
      if (millis()> currentTime + (3000-t)){
        fill (0);
        text ("LOSE", 320,160);
        lose= true;
        fill (255);
      }
      
      if (win == true){
        if (millis()>currentTime+2500-t){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
        }
      }
        
     if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
     }
      
        
      ellipse(circleX22, circleY22, circleRadius22, circleRadius22); 
       
    } 
     
    boolean circleCircleIntersect(float cx1, float cy1, float cr1, float cx2, float cy2, float cr2) { 
      if (dist(cx1, cy1, cx2, cy2) < cr1 + cr2) { 
        return true; 
      } else { 
        return false; 
      } 
    
    } 
     
    
    void mouseDragged() {
      if (page == 2){
      if (mouseX<x2+50){
        if (mouseX>x2-50){
          if (mouseY>y2-50){
            if (mouseY<y2+50){
                x2 = mouseX;
                y2 = mouseY;
            }
          }
        }
        }
      }
      if (page==3){
        if (mouseX<x3+50){
        if (mouseX>x3-50){
          if (mouseY>y3-80){
            if (mouseY<y3+80){
                x3 = mouseX;
            }
          }
        }
      }
      }
    }
    
    void gameThree(){
     
      win= false;
      background(225); 
      
      fill (0);
      
      println(millis());
      
     if (millis()<currentTime+1000){ 
      textSize (18);
      text("Catch!", 320,280);
      }
    
      circleX23 = x3; 
      circleY23 = y3; 
      
      strokeWeight(10);
      line(x3,y3, x3+30,y3-50);
      line(x3,y3, x3-30,y3-50);
      strokeWeight(1);
    
    if (millis()>currentTime+1000){
     circleY13+= speed3;
    }
     fill (0);
     ellipse(circleX13, circleY13, circleRadius13, circleRadius13); 
     fill (255);
      
     if (mouseX<x3+20){
       if (mouseX>x3-20){
         if (mouseY>y3-20){
           if (mouseY<y3+20){
              fill (200);
            }
            else {
              fill (255);
            }
          }
        }
     }
       
      if (circleCircleIntersect(circleX13, circleY13, circleRadius13, circleX23, circleY23, circleRadius23+25) == true) { 
    fill (0);
    textSize (24);
    circleY13-= speed3;
    circleX13= circleX23;
    text ("WIN", 210,160);
        win= true;
      } 
      
      if (win == true){
        if (millis()>currentTime+3000){
        pctmain= 0.0;
        page = 0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
      }
      }
      
       
    if (circleY13>340){
      if (millis()>currentTime+3000){
        fill(0);
        page = 0;
        lose= true;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
    }
    }
    
    
    
      ellipse(circleX23, circleY23, circleRadius23, circleRadius23); 
       
    } 
     
    
    
    
    void gameFour() {
      
      win= false;
      background (225);
      
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
      if ((currentTime+ (4500-t)) - millis()<=4500){
        if ((currentTime+ (4500-t)) - millis()>=3000){
          timer = 4;
        }
      }
      
      if ((currentTime+ (4500-t)) - millis()<=3000){
        if ((currentTime+ (4500-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (4500-t)) - millis()<=2000){
        if ((currentTime+ (4500-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (4500-t)) - millis()<=1000){
        if ((currentTime+ (4500-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (4500-t)) - millis()<=0){
        if ((currentTime+ (4500-t)) - millis()>=-10000){
          timer = 0;
        }
      } 
      
     if (millis()<currentTime+1000){
        textSize (30);
        text ("Divide", 180,200);
      }
        
      
      textSize (18);
      text ("Rectangles",310,25);
      text ("Circles", 90,25);
      
      line (240,0,240,320);
      
      strokeWeight (20);
      strokeCap(SQUARE);
      line (x14,y14,x14,y24);
      line (a14,b14,a14,b24);
      strokeWeight (1);
      fill (0);
      ellipse (circleX14,circleY14,circleRadius14,circleRadius14);
      ellipse (circleX24,circleY24,circleRadius24,circleRadius24);
     
    //Rectangle triggers 
     if (mousePressed==true){ 
      if (mouseX<x14+30){
        if (mouseX>x14-30){
          if (mouseY<y14+50){
            if (mouseY>y14-50){
              if (locked24==false){
                if (locked34==false){
                  if (locked44==false){
                   locked14= true;
                    }
                  }
                }
              }
            }
          }
       }
     } else {
       locked14= false;
        
    }
    
      if (locked14== true){
             x14= mouseX;
             y14= mouseY-25;
             y24= mouseY+25;
        }
     
     if (mousePressed==true){ 
      if (mouseX<a14+30){
        if (mouseX>a14-30){
          if (mouseY<b14+50){
            if (mouseY>b14-50){
              if (locked14==false){
                if (locked34==false){
                  if (locked44==false){
                     locked24= true;
                     boolean locked14=false;
               }
            }
          }
        }
        }
     }
      }
     } else {
       locked24= false;
        
    }
    
      if (locked24== true){
             a14= mouseX;
             b14= mouseY-25;
             b24= mouseY+25;
        }
        
        
    //Circle Triggers
    if (mousePressed== true){
      if (mouseX<circleX14+30){
        if (mouseX>circleX14-30){
          if (mouseY<circleY14+35){
            if (mouseY>circleY14-35){
              if (locked14==false){
                if (locked24==false){
                  if (locked44==false){
                    locked34= true;
                  }
                }
              }
            }
          }
        }
      }
    } else{
      locked34= false;
    }
    
    if (locked34== true){
            circleX14= mouseX;
            circleY14= mouseY;
    }
    
    
    
    if (mousePressed== true){
      if (mouseX<circleX24+30){
        if (mouseX>circleX24-30){
          if (mouseY<circleY24+35){
            if (mouseY>circleY24-35){
              if (locked14==false){
                if (locked24==false){
                  if (locked34==false){
                    locked44= true;
                  }
                }
              }
            }
          }
        }
      }
    } else{
      locked44= false;
    }
    
    if (locked44 == true){
            circleX24= mouseX;
            circleY24= mouseY;
    }
    
    
      if (x14> 250){
        if (a14>250){
          if (circleX14<230){
            if (circleX24<230){
              win = true;
              textSize(24);
              text ("WIN", 210,160);
            }
          }
        }
      }
    
    
    if (millis()> currentTime + (4500-t)){
      fill (0);
      text ("LOSE", 320,160);
      lose= true;
      fill (255);
    }
      
    
      if (win == true){
        if (millis()>currentTime+4000-t){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
        }
      }
        
     if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
     }
     
     
    
    
    }
    
    void gameFive(){
      
      win= false; 
      background (225);
      noCursor();
      
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
      if ((currentTime+ (3000-t)) - millis()<=3000){
        if ((currentTime+ (3000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (3000-t)) - millis()<=2000){
        if ((currentTime+ (3000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (3000-t)) - millis()<=1000){
        if ((currentTime+ (3000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (3000-t)) - millis()<=0){
        if ((currentTime+ (3000-t)) - millis()>=-10000){
          timer = 0;
        }
      }     
    
      
      if (mouseX<circleX35+40){
        if (mouseX>circleX35-40){
          if (mouseY<circleY35+40){
            if (mouseY>circleY35-40){
               fill(125);
     
                  }else {
                    fill(255);
                  }
                }else{
                  fill(255);
                }
              }
              else{
                fill(255);
              }
            }else{
            fill(255);
            }
         ellipse(circleX15, circleY35, circleRadius15, circleRadius15);
      
      if (millis()<currentTime+1000){
        if (trigger5 == false){
          textSize (30);
          fill(0);
          text ("Shoot!", 180,160);
        }
      }
            
      circleX15+= speed5*direction5;
      circleX35= circleX15+speed5*direction5;
      circleY35= 80*(sin(circleX15/20))+160;
      float circleX25 = mouseX; 
      float circleY25 = mouseY;
      strokeWeight(1);
      fill(255);
      fill(0);
      strokeWeight(5);
      line (mouseX,mouseY-35,mouseX,mouseY+35);
      line (mouseX-35,mouseY,mouseX+35,mouseY);
      noFill();
      ellipse(circleX25, circleY25, circleRadius25, circleRadius25);
      strokeWeight(1);
      
      if (circleX15>460) {
        direction5 *= -1;
      }
      
      if (circleX15<20){
        direction5 *= -1;
      }
      
      if (circleY25>300) {
        direction25 *= -1;
      }
      
      if (circleY25<20){
        direction25 *= -1;
      }
      
      if (mousePressed){
        background(255);
      }
      
      if (mousePressed){
       if (mouseX<circleX35+40){
        if (mouseX>circleX35-40){
          if (mouseY<circleY35+40){
            if (mouseY>circleY35-40){
              trigger5= true;
            }
          }
        }
       }
      }
      
      if (trigger5== true){
        win = true;
      }
      
      if (win == true){
        textSize(24);
        text ("WIN", 210,160);
        circleRadius15 = 0;
        if (millis()>currentTime+2500-t){
          page = 0;
          pctmain= 0.0;
          xmain = startXmain;    
          x2main= startX2main; 
          pct2main = 0.0;
          closed = false;
          currentTime= millis();
          w +=1;
          g +=1;
          cursor();
      }  
    }
    
      if (millis()> currentTime + (3000-t)){
        fill (0);
        text ("LOSE", 320,160);
        lose= true;
        fill (255);
      }
      
     if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
        cursor();
     }
    
    
    }
    
    void gameSix(){
      
      win= false; 
      background(225); 
      
      fill(0);
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
        if ((currentTime+ (3000-t)) - millis()<=3000){
        if ((currentTime+ (3000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (3000-t)) - millis()<=2000){
        if ((currentTime+ (3000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (3000-t)) - millis()<=1000){
        if ((currentTime+ (3000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (3000-t)) - millis()<=0){
        if ((currentTime+ (3000-t)) - millis()>=-10000){
          timer = 0;
        }
      }      
    
      
     if (millis()<currentTime+1000){
         fill(0);
         textSize(24);
         text("Stretch!",100,line26-40);
       }
       
      strokeWeight(10);
      stroke(0);
      line (line16,line26,line36,line46);
      
     if (mousePressed){
       if (mouseX<line36+30){
        if (mouseX>line36-30){
          if (mouseY<line46+35){
            if (mouseY>line46-35){
              locked6= true;
            }
          }
        }
       }
     } else {
       locked6= false;
     }
     
    if (locked6 == true){
      line36= mouseX;
      line46= mouseY;
    }
    
    if (line36>350){
      textSize(24);
      fill(0);
      text ("WIN", 210,160);
      win= true;
    }
    
    if (millis()> currentTime + (3000-t)){
      fill (0);
      text ("LOSE", 320,160);
      lose= true;
      fill (255);
    }
    
      if (win == true){
        if (millis()>currentTime+2500-t){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
        }
      }
      
       if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
     }
    
    
      
    }
      
    
    void gameSeven(){
      
       background(225); 
       strokeWeight(1);
       fill(0);
       ellipse (295,225,30,30);
       ellipse (380,185,30,30);
       strokeCap(SQUARE);
       strokeWeight(40);
       line (110,145,110,255);
       line (50,200,170,200);
       
       
        if (millis()<currentTime+1000){
          if (pressed7==1){
           fill(0);
           textSize(24);
           text("Press UP!",100,40);
          }
       }
       
       if (millis()<currentTime+1000){
          if (pressed7==2){
           fill(0);
           textSize(24);
           text("Press DOWN!",100,40);
          }
       }
       
       if (millis()<currentTime+1000){
          if (pressed7==3){
           fill(0);
           textSize(24);
           text("Press LEFT!",100,40);
          }
       }
       
       if (millis()<currentTime+1000){
          if (pressed7==4){
           fill(0);
           textSize(24);
           text("Press RIGHT!",100,40);
          }
       }
       
       if (millis()<currentTime+1000){
          if (pressed7==5){
           fill(0);
           textSize(24);
           text("Press A!",100,40);
          }
       }
       
       if (millis()<currentTime+1000){
          if (pressed7==6){
           fill(0);
           textSize(24);
           text("Press B!",100,40);
          }
       }
       
      fill(0);
      textSize(18);
      text ("Time Left: " +timer, 350, 300);
      
      if ((currentTime+ (3000-t)) - millis()<=3000){
        if ((currentTime+ (3000-t)) - millis()>=2000){
          timer = 3;
        }
      }
    
      if ((currentTime+ (3000-t)) - millis()<=2000){
        if ((currentTime+ (3000-t)) - millis()>=1000){
          timer = 2;
        }
      }      
    
      if ((currentTime+ (3000-t)) - millis()<=1000){
        if ((currentTime+ (3000-t)) - millis()>=0){
          timer = 1;
        }
      }  
      if ((currentTime+ (3000-t)) - millis()<=0){
        if ((currentTime+ (3000-t)) - millis()>=-10000){
          timer = 0;
        }
      }   
       
    //Highlight
       
      if (mouseX>80){
        if (mouseX<130){
          if (mouseY>150){
            if (mouseY<180){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     textSize(9);
     text ("UP", 104,165);
     
       if (mouseX>80){
        if (mouseX<140){
          if (mouseY>230){
            if (mouseY<260){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     textSize(8);
     text ("DOWN", 96,245);
     
     if (mouseX>45){
       if (mouseX<75){
          if (mouseY>190){
            if (mouseY<220){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     text ("LEFT", 60,205);
     
      if (mouseX>125){
       if (mouseX<175){
          if (mouseY>190){
            if (mouseY<220){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     text ("RIGHT", 140,205);
     
      if (mouseX>255){
       if (mouseX<315){
          if (mouseY>200){
            if (mouseY<260){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     textSize(30);
     text ("B", 286,233);
     
     if (mouseX>340){
       if (mouseX<400){
          if (mouseY>160){
            if (mouseY<220){
              fill (125);
              }else {
                fill (255);
              }
            }else {
              fill (255);
            }
          }else {
          fill (255);
        }
      }else {
        fill (255);
     }
     
     text ("A", 371,192);
       
       
    //Win Triggers
    //UP
    if (mousePressed){
      if (mouseX>80){
        if (mouseX<130){
          if (mouseY>150){
            if (mouseY<180){
              if (pressed7==1){
              win = true;
              }
            }
          }
      }
    }
    }
    
    //DOWN
    if (mousePressed){
       if (mouseX>80){
        if (mouseX<140){
          if (mouseY>230){
            if (mouseY<260){
              if (pressed7==2){
              win = true;
              }
              }
            }
          }
       }
    }
      
    //LEFT
    if (mousePressed){
     if (mouseX>45){
       if (mouseX<75){
          if (mouseY>190){
            if (mouseY<220){
              if (pressed7==3);
              win = true;
              }
            }
          }
      }
    }
    
    //RIGHT
    if (mousePressed){
      if (mouseX>125){
       if (mouseX<175){
          if (mouseY>190){
            if (mouseY<220){
              if (pressed7==4){
                win = true;
              }
            }
          }
        }
      }
    }
    
    //A
    if (mousePressed){
     if (mouseX>340){
       if (mouseX<400){
          if (mouseY>160){
            if (mouseY<220){
              if (pressed7==5){
                win = true;
              }
            }
          }
        }
     }
    }
    
    
    
    //B
    if (mousePressed){
      if (mouseX>255){
       if (mouseX<315){
          if (mouseY>200){
            if (mouseY<260){
              if (pressed7==6){
                win = true;
              }
            }
          }
        }
      }
    }
      
      if (win == true){
        fill(0);
        textSize(24);
        text ("WIN", 210,160);
        if (millis()>currentTime+2500-t){
          page = 0;
          pctmain= 0.0;
          xmain = startXmain;    
          x2main= startX2main; 
          pct2main = 0.0;
          closed = false;
          currentTime= millis();
          w +=1;
          g +=1;
        }
      }
      
     if (millis()> currentTime + (3000-t)){
        fill (0);
        textSize (24);
        text ("LOSE", 320,160);
        lose= true;
        fill (255);
      }
    
     if (lose == true){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
     }
       
    }
    
    void gameEight(){      
       win= false;
       background(225);
       circleX8 = mouseX;
       noCursor(); 
       
      if (millis()<currentTime+1000){
         fill(0);
         textSize(24);
         text("Dodge!",100,40);
       }
    
    if (millis()>currentTime+1000){   
       rectY8+=speed8 * direction8;
       rectY28+=speed8 * direction8;
       
       fill (0); 
       rect (rectX8,rectY8,rectWidth8,rectHeight8);
       rect (rectX28-w8,rectY28,rectWidth28+w8,rectHeight28);
    }
    
    if (rectCircleIntersect(rectX8, rectY8, rectWidth8, rectHeight8, circleX8, circleY8, circleRadius8) == true) { 
        fill(255);  
        lose = true;
      }  
      else { 
        fill(0);  
      } 
      
    if (rectCircleIntersect(rectX28-w8, rectY28, rectWidth28+w8, rectHeight28, circleX8, circleY8, circleRadius8) == true) { 
        fill(255);  
        lose = true;
        speed8 = 0;
      }   
      
    if (lose == true){
      textSize (24);
      text ("LOSE", 210,160);
      speed8 = 0;
      cursor();
      if (millis()>currentTime+4500){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
      }
    }
    
    ellipse (circleX8, circleY8, circleRadius8, circleRadius8);
    
    if (rectY28>500){
      win = true;
    }
    
    if (win == true){
      text ("WIN", 210,160);
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
       cursor();
    }
    
    
    
       
    }
    
    boolean rectCircleIntersect(float rx, float ry, float rw, float rh, float cx, float cy, float cr) { 
     
      float circleDistanceX = abs(cx - rx - rw/2); 
      float circleDistanceY = abs(cy - ry - rh/2); 
     
      if (circleDistanceX > (rw/2 + cr)) { return false; } 
      if (circleDistanceY > (rh/2 + cr)) { return false; } 
      if (circleDistanceX <= rw/2) { return true; }  
      if (circleDistanceY <= rh/2) { return true; } 
     
      float cornerDistance = pow(circleDistanceX - rw/2, 2) + pow(circleDistanceY - rh/2, 2); 
      return cornerDistance <= pow(cr, 2); 
    } 
     
    
    void gameNine(){
       win= false;
       background(225); 
       noCursor();
        if (millis()<currentTime+1000){
         fill(0);
         textSize(24);
         text("Through the Loop!",100,40);
       }
       
       circleX29= lineX9;
       circleY29= mouseY;
       
       if (millis()>currentTime+1000){
       lineX9+= -speed9;
       }
       
       line (lineX9+100,mouseY,lineX9,mouseY);
       noFill();
       strokeWeight(5);
       ellipse (circleX19,circleY19,circleRadius39,circleRadius19);
       
       ellipse(circleX29, circleY29, circleRadius29, circleRadius29); 
    
       
      if (circleCircleIntersect(circleX19, circleY19, circleRadius19, circleX29, circleY29, circleRadius29) == true) { 
        fill(0);  
        trigger9= true;
      }
      
      if (trigger9 == true){
        win = true;
      }
      
      if (win == true){
        text ("WIN",210,160);
      if (millis()>currentTime+3000){
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        w +=1;
        g +=1;
        cursor();
        
      }
    
    }
    
    if (millis()>currentTime+3000){
       if (win == false){
       lose= true;
        }
     }
     
     if (lose == true){
       text ("LOSE",210,160);
        page = 0;
        pctmain= 0.0;
        xmain = startXmain;    
        x2main= startX2main; 
        pct2main = 0.0;
        closed = false;
        currentTime= millis();
        l +=1;
        g +=1;
        cursor();
     }
     
     
    }
    
    
    void losePage(){
    
      textSize (30);
      text ("Try Again?", 160,160);
      
      if (mouseX>140){
        if (mouseX<350){
          if (mouseY>120){
            if (mouseY<180){
              fill (125);
              }else {
                fill (0);
              }
            }else {
              fill (0);
            }
          }else {
          fill (0);
        }
      }else {
        fill (0);
     }
     
       if (mouseX>140){
        if (mouseX<350){
          if (mouseY>120){
            if (mouseY<180){
              if (mousePressed == true){
                page = -3;
                l = 0;
                currentTime= millis();
               
              }
            }
          }
        }
       }
              
      
    }
      
    
    
    void titlePage(){
      
    //Reset Score & Difficulty Variables
      g= 0;
      w= 0;
      l= 0;  
      s = 0;
      t = 0;
      s3= 0;
      s4= 0;
      w8= 0;
      speed3= 3.5;
      
      background (225);
      textSize (40);
      fill (0);
      text ("PUZZLE PANIC!", 87,150);
      textSize(20);
      text ("Click to Proceed", 152, 290);
      fill (255);
      
      circleY1t+= speed3*direction;
      circleY2t+= speed3*direction2;
      ellipse(circleX1t, circleY1t, circleRadius1t, circleRadius1t);
      ellipse(circleX2t, circleY2t, circleRadius2t, circleRadius2t);  
      
      if (circleY1t>300) {
        direction *= -1;
      }
      
      if (circleY1t<20){
        direction *= -1;
      }
      
      if (circleY2t>300) {
        direction2 *= -1;
      }
      
      if (circleY2t<20){
        direction2 *= -1;
      }
      
      if (mousePressed){
        if (millis()>currentTime+500){
        if (page == -3){
        page = -4;
        currentTime= millis();
      }
      }
      }
    }
    
    void instructionsPage(){
      background (225);
      textSize (14);
      fill (0);
      text ("You have a set number of seconds to solve numerous puzzles with minimal instruction. You gain a point for every puzzle solved and lose a life for every puzzle not solved. Speed and difficulty of puzzles increases as more puzzles are solved. Game ends when all 3 lives are lost. Game timer is displayed at the bottom right when timer is needed.",50,50, 400,400);
      text ("Controls: Mouse Click & Mouse Move", 180,200);
      text ("Click to Start!", 60, 280);
      if (mousePressed){
        if (millis()>currentTime+350){     
        page = 0;
        currentTime= millis();
        }
      }
    } 
    
    void mainPage(){
      // reset variables
          s2= 0;
         //Game 1
           circleX = 280; 
           circleY = 15; 
           circleRadius = 15; 
     
           lineX1 = 220; 
           lineY1 = 300; 
    
           stopX= 247;
           stopY= 225;
    
           lineX2 = 140;
           lineY2 = 300; 
           theta = 0.0;
    
           angle = -180;
           offset = 220;
           scalar = 80;
           speed1 = 0.4;
           speed2 = 3.5+s;
           direction = 1;
           hit = false;
     
           
         //Game 2  
            circleX12 = 420;       
            circleRadius12 = 30;   
            circleY12 = random (75,250); 
            x2= random(0,320);
            circleY22= random(75,290);
            
         //Game 3
            circleY13 = random (50,270);
            x3= random(0,320);
            y3= random(0,320);
            circleY13 = 15; 
            circleRadius13 = 15;   
            circleRadius23 = 1; 
            x3= 50;
            y3= 290;
            speed3 = 3.5+s;
            
         //Game 4
           circleX14 = random (20,220);
           circleY14 = random (50,270); 
           circleRadius14 = 15;
    
           circleX24 = random (260,460); 
           circleY24 = random (50,270); 
           circleRadius24 = 15; 
    
           x14 = random (20,220);
           y14 = random (50,230);
           x24 = x14;
           y24 = y14+50;
    
           a14 = random (260,460);
           b14 = random (50,230);
           a24 = 300;
           b24 = b14+50;
    
           locked14= false;
           locked24= false;
           locked34= false;
           locked44= false;       
           strokeCap(ROUND);
           
        //Game 5
          circleX15 = random (40,440); 
          circleY15 = 140;
          circleRadius15 = 40;
          circleX25 = mouseX; 
          circleY25 = mouseY;
          circleRadius25 = 25; 
          speed5 = 2+s3;
          direction5 = 1;
          direction25= 1;
          trigger5= false;
          
        //Game 6
          line16= 0;
          line26= int (random (70,290));
          line36= 100;
          line46= line26;
          locked6= false;
          
        //Game 7
          pressed7 = int (random (1,7));
          
        //Game 8
          rectX8=0;
          rectY8=-500;
          rectX28=225;
          rectY28=-1100;
          direction8 = 1;
          speed8= 5+s4;
          circleX8 = mouseX;
          circleY8 = 280;
          circleRadius8= 30;
          
        //Game9
          trigger9= false;
          lineX9= 350;
          circleY19= random (75,270);
          speed9 = 4+ s4;
          circleRadius19= 30;
          circleRadius39= 7;
          circleRadius29= 1;
          
        //Game10
          ellipseY10= 200;
          text10= 200;
          lineY10= 255;
          p10 = 0;
          
        //Game11
          circleX11= 100;
          circleY11= 40;
          circleY311= 40;
          circleRadius11= 20;
          circleRadius113= 2;
          direction11= 1;
          speed11= 3+s4;
          rectX11= random(0,280);
          rectY11= 280;
          rectWidth11= 100;
          rectHeight11= 100;
          trigger11= false;
          trigger211= true;
          trigger311= false;
    
      
      if (win == true){
        wint= true;
      }
      
      if (lose == true){
        loset= true;
      }
      
      background (225);
     
      if (pctmain < 1.0) {
        xmain = startXmain + ((stopXmain-startXmain) * pctmain);
        pctmain += stepmain;
      }
      
      fill (255);
      strokeWeight (1);
      rect (xmain,-20,300,500); 
      
      if (pct2main<1.0){
        x2main = startX2main + ((stopX2main-startX2main)* pct2main);
        pct2main += stepmain;
      }
      
       rect (x2main,-20,300,500);
       
        fill (0);
        textSize(18);
        text ("Score: " + w, 360,275);
        text ("Lives: " + (3-l), 360,300);  
        fill (255);
        
     if (wint== true){
        if (millis ()< currentTime+1500){
        fill (0);
        textSize (24);
        text ("WIN", 210,160);
        }
      }
      
      if (loset== true){
          if (l<3){
          if (millis ()< currentTime+1500){
          fill (0);
          textSize (24);
          text ("LOSE", 210,160);
          }
        }
      }
      
      if (g == 5){
       if (l < 3){
        s2= 2000;
        if (millis ()> currentTime+1000){
          if (millis()<currentTime+3000){
          fill (0);
          textSize (30);
          text ("SPEED UP!", 160,160);
          textSize (18);
          fill (255);
          s = 1;
          t = 500;
          s3= 0.5;
          s4= 2;
          w8= 50;
        }
        }
        }
      }
      
      if (g == 10){
         if (l <3){
           s2= 2000;
           if (millis ()> currentTime+1000){
             if (millis()<currentTime+3000){
              fill (0);
              textSize (30);
              text ("SPEED UP!", 160,160);
              textSize (18);
              fill (255);
              s = 2;
              t = 1000;
              s3= 1;
              s4= 4;
              w8=100;        
          }
         }
        }
      }
      
      if (millis()>currentTime+1500+s2){
          if (l<3){
          fill(0);
          textSize(30);
          text ("READY?", 180,160);
          fill (255);
        }
      }
      
      
      win = false;
      lose = false;
      
      
      if (millis ()> currentTime+ 1000){
        wint = false;
        loset= false;
      }
      
       
      
      if (millis()>currentTime+3500+s2){
        if (l<3){
          closed = true;
        }
      }
      
      if (closed == true){
        if (l<3){
          page = -1;
        }
      }
      
      if (l == 3){
        if (millis()<currentTime+4000){
          textSize (30);
          fill (0);
          text ("LOSE",200,160);
          circleX1t = 45; 
          circleY1t = 20;
          circleX2t = 440; 
          circleY2t = 300;
        }
        if (millis()>currentTime+4000){
        page = -2;
      }
     }
      
      
    }
    
    void mainPage2(){
      
        background (225);
    
      xmain = stopXmain;
      x2main = stopX2main;
      
      if (pctmain > 0.0) {
        xmain = startXmain + ((stopXmain-startXmain) * pctmain);
        pctmain -= stepmain;
      }
      
      
      rect (xmain,-20,300,500); 
      
      if (pct2main > 0.0){
        x2main = startX2main + ((stopX2main-startX2main)* pct2main);
        pct2main -= stepmain;
      }
      
       rect (x2main,-20,300,500);
      
      if (pct2main<0.0){
        //page = 11;
        page = int (random (1,12));
        currentTime = millis();
      } 
    
    }
    
    
    // Main Game Variables
    int page = -3;
    PFont font;
    int startXmain = -300;     
    int stopXmain =-30;    
    int startX2main= 780;
    int stopX2main= 210;
    float xmain = startXmain;    
    float x2main= startX2main;  
    float stepmain = 0.05;
    float stepmain2= -0.05;
    float pctmain = 0.0;
    float pct2main = 0.0;  
    int startingTime;
    boolean win = false;           //win trigger
    boolean lose = false;          //lose trigger
    boolean closed = false;        //main menu "door"
    int currentTime= 0;            //timer variable
    int g = 0;                     //game number variable
    int g1= 0;                     //difficulty changer variable
    int s2= 0;                     //timer mainpage addons
    
    //titlePage variables
    float circleX1t = 45; 
    float circleY1t = 20;
    float circleRadius1t = 15;
    float circleX2t = 440; 
    float circleY2t = 300;
    float circleRadius2t = 15; 
    int direction2= 1;
    
    
    //Timer variables
    int timer= 0;
    
    //Game Difficulty Variables
    int s = 0;                      //speed increaser
    int t = 0;                       //time decreaser
    float s3 = 0;
    int s4= 0;
    int w8= 0;
    float pd10= 0.0;
    
    //Score Variables
    int w = 0;                      //number of wins
    int l = 0;                      //number of lives
    
    //Display Text
    boolean wint = false;
    boolean loset = false;
    
    
    //Game 1 Variables
    float circleX = 280; 
    float circleY = 15; 
    float circleRadius = 15; 
     
    float lineX1 = 220; 
    float lineY1 = 300; 
    
    float stopX= 247;
    float stopY= 225;
    
    float lineX2 = 140;
    float lineY2 = 300; 
    float theta = 0.0;
    
    float angle = -180;
    float offset = 220;
    float scalar = 80;
    float speed1 = 0.4;
    float speed2 = 3;
    int direction = 1;
    boolean hit = false;
    
    
    //Game 2 Variables
    float circleX12 = 420; 
    float circleY12 = random (75,270); 
    float circleRadius12 = 30; 
     
    float circleX22, circleY22; 
    float circleRadius22 = 20; 
    
    float x2= random(0,320);
    float y2= random(75,270);
    
    float x21=x2;
    float y21=y2;
    
    //Game 3 Variables
    
    float circleX13 = random (75,430); 
    float circleY13 = 15; 
    float circleRadius13 = 15; 
     
    float circleX23, circleY23; 
    float circleRadius23 = 1; 
    
    float x3= 50;
    float y3= 290;
    
    float speed3 = 3.5;
    
    //Game 4 Variables
    
    float circleX14 = random (20,220);
    float circleY14 = random (50,260); 
    float circleRadius14 = 15;
    
    float circleX24 = random (260,460); 
    float circleY24 = random (50,260); 
    float circleRadius24 = 15; 
    
    float x14 = random (20,220);
    float y14 = random (50,210);
    float x24 = x14;
    float y24 = y14+50;
    
    float a14 = random (260,460);
    float b14 = random (50,210);
    float a24 = 300;
    float b24 = b14+50;
    
    boolean locked14= false;
    boolean locked24= false;
    boolean locked34= false;
    boolean locked44= false;
    
    
    //Game 5 Variables
    float circleX15 = random (40,440); 
    float circleY15 = 140;
    float circleRadius15 = 40;
    float circleX25 = mouseX; 
    float circleY25 = mouseY;
    float circleX35;
    float circleY35;
    float circleRadius25 = 25; 
    float speed5 = 2;
    int direction5 = 1;
    int direction25= 1;
    boolean trigger5= false;
    
    //Game 6 Variables
    int line16= 0;
    int line26= int (random (70,290));
    int line36= 100;
    int line46= line26;
    boolean locked6= false;
    
    //Game 7 Variables
    int pressed7 = int (random (1,7));
    
    //Game 8 Variables
    float rectX8=0;
    float rectY8=-500;
    float rectX28=225;
    float rectY28=-1100;
    int direction8 = 1;
    int speed8= 5;
    float circleX8 = mouseX;
    float circleY8 = 280;
    float circleRadius8= 30;
    float rectWidth8= 300;
    float rectHeight8= 300;
    float rectWidth28= 400;
    float rectHeight28= 300;
    
    //Game 9 Variables
    boolean trigger9= false;
    float lineX9= 350;
    int speed9 = 4;
    float circleX19= 100;
    float circleY19= random (75,270);
    float circleRadius19= 30;
    float circleRadius39= 7;
    float circleRadius29= 1;
    float circleX29;
    float circleY29;
    
    //Game 10 Variables
    
    int ellipseY10= 200;
    int text10= 200;
    float lineY10= 255;
    float p10 = 0;
    
    //Game 11 Variables
    float circleX11= 100;
    float circleY11= 40;
    float circleX311;
    float circleY311= 40;
    float circleX211;
    float circleY211; 
    float circleRadius11= 20;
    float circleRadius113= 2;
    int direction11= 1;
    int speed11= 4;
    float rectX11= random(0,280);
    float rectY11= 280;
    float rectWidth11= 100;
    float rectHeight11= 100;
    boolean trigger11= false;
    boolean trigger211= true;
    boolean trigger311= false;
    
    
    void setup() { 
      size(480, 320);  
      ellipseMode(RADIUS); 
      font = loadFont ("MagicalMysteryTour-48.vlw");
      textFont(font);
      smooth(); 
      background(225);
      
    } 
    
    
    
    void draw(){
      
    if (page == -3){
      titlePage();
    }else if (page == -4){
      instructionsPage();
    }else if (page == 0){        //mainpage1
      mainPage();
    }else if (page == -1){      //mainpage 2
      mainPage2();
    }else if (page == -2){      //losing page
      losePage();
    }else if (page == 1){       //games according to their numbers
      gameOne();
    }else if (page == 2){
      gameTwo();
    }else if (page == 3){
      gameThree();
    }else if (page == 4){
      gameFour();
    }else if (page == 5){
      gameFive();
    }else if (page == 6){
      gameSix();
    }else if (page == 7){
      gameSeven();
    }else if (page == 8){
      gameEight();
    }else if (page == 9){
      gameNine();
    }else if (page == 10){
      gameTen();
    }else if (page == 11){
      gameEleven();
    }
    
    
    
    //println (mouseX);
    //println (mouseY);
    //println(g);
    //println(s);
    //println(s2);
    
    //if (win == true){
    //page = 0;
    //win= false;
    
    
    //println(win);
    //}
    
    
    //if (lose == true){
      //page = 2;
      //page = 3;
    //}
    
    //println (time);
    //println (closed);
    //println (currentTime);
    //println (timer);
    
    }
    
    
    
    void gameRandom(){ 
    //  page = 1;
      
    //  if (page == 0){
    //    mainPage();
    //  }
    //  if (page == 1){
    //    gameOne();
    //  }else if (page == 2){
    //    gameTwo();
    
    //  } 
    }
    
    
    
    

    code

    tweaks (0)

    about this sketch

    This sketch is running as Java applet, exported from Processing.

    license

    advertisement

    Thomas Lu

    test

    Add to Faves Me Likey@! 1
    You must login/register to add this sketch to your favorites.

    You need to login/register to comment.