Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
//Jesse Toyota
//991359393
//High Tension: The Unforgiven

//variables for height/width
int x;
int h;
int y;
int r=0;
int underWear=0;
//variables for dialogue timers
int time;
int time2;
int colorChange=0;

//setup
void setup () {
  size(400, 400);
}


void draw () {
  
  //background
  background(-colorChange+100, -colorChange+100, -colorChange+100);
  noStroke();
  fill(180);
  rect(0, 150, 400, 100);

//initialize y for idle movement.
  y=mouseY-100;

//Check if mouse/character has hit invisible wall, or can move freely.   
  if (mouseX>=125) {
    x=mouseX;
    h=0;
    r=0;
    time=0;
    
  } else {
    x=125;
    h=0;
    r=5;

    time++;
    if (time==1) {
      ;
      println("What are you doing?");
    }

//Check if mouse is pressed while against invisible wall. If yes; then wedgie.
    if (mousePressed) {
      colorChange=-50+time2/5;
      time2++;
      h=3;
      r=0;
      y=mouseY-200;
      for (underWear=0; underWear<10; underWear++)
      //Dialogue plays and continues as "time2" increments, "h++" represents "hopping". 
        if (time2==1) {
          println("Ow!");
          print("Ow!");
        }
      if (time2==40) {
        println("OW!!");
      }
      if (time2==90) {
        println("OWOWOW!!!!");
        h++;
      }
      if (time2==120) {
        println("STOP!!!");
        h++;
      }
      if (time2==190) {
        println("MY ASS!!!");
        h++;
      }
      if (time2==280) {
        println("DEAR GOD!!!!!!");
        h++;
      }
      if (time2==330) {

        println("WHY?!?!?!");
        h++;
      }
      if (time2==500) {
        println("Eh, could be worse.");
      }
      if (time2==700) {
        println("Did I ever introduce you to my son?");
      }
      if (time2==900) {
        println("My son Tim should be coming along soon.");
      }
      if (time2==1100) {
        println("I feel like you guys would be good frie-");
      }
      if (time2==1175) {
        println("NO TIMMY DON'T LOOK AT YOUR FATHER!");
        h++;
      }
      if (time2==1300) {
        println("THE UNFORGIVABLE SHAME...!");
      }
      if (time2==1700) {
        println("Okay, you can put me down now. Try hard.");
      }
    } else {
      underWear=0;
      y=mouseY-100;
      time2=0;
      colorChange=0;
    }
  }
  
  //PLAYER MODEL
  {
    noStroke();
    fill(230);
    rect(x-5, 80, 50, 60);
    //body

    noStroke();
    fill(150);
    rect(x-5, 140, 20, 10);
    rect(x+25, 140, 20, 10);
    rect(x-5, 120, 50, 20);
    //pants

    noStroke();
    fill(255);
    ellipse(x+5, 92, 18, 18);
    ellipse(x+25, 92, 18, 18);
    noStroke();
    fill(0);
    ellipse(x+23, 88+mouseY/20, 10, 10);
    ellipse(x+3, 88+mouseY/20, 10, 10);
    fill(230);
    noStroke();
    rect(x-5, 98, 50, 5);
    //eyes

    noStroke();
    fill(200);
    quad(x-20, 115+y/10, x-5, 115, x-5, 105, x-20, 105+y/10);
    quad(x+5, 115+y/10, x+35, 115, x+35, 105, x+5, 105+y/10);
    //arms
  }


  //NPC MODEL
  {
    noStroke();
    fill(200);
    rect(80, 80-h, 50, 60);
    //body

    noStroke();
    fill(255);  
    triangle(80, 140-underWear, 130, 110-underWear, 130, 140-underWear);
    //underwear

    noStroke();
    fill(150);
    rect(80, 140-h, 20, 10);
    rect(110, 140-h, 20, 10);
    rect(80, 120-h, 50, 20);
    //pants


    noStroke();
    fill(255);
    ellipse(92, 92-h, 18, 18);
    ellipse(115, 92-h, 18, 18);
    noStroke();
    fill(0);
    ellipse(92+r, 92-h, 10-h, 10-h);
    ellipse(115+r, 92-h, 10-h, 10-h);
    fill(200);
    noStroke();
    rect(80, 80-h*2, 50, 5);
    //eyes
  }

  //Color overlay fade
  noStroke();
  fill(-colorChange+255, colorChange*2, colorChange*3/2, colorChange);
  rect(0, 0, 400, 400);
}