////     Kweku Cush
/// Prof. B.A.Martin

void setup() {
  //// Set up frame size, etc. 
  size( 600, 400 );
  background(3, 236, 255);
}



//
void draw() {  
  // Draw the next frame.
  noCursor();
  scene();
  hero();
  eyes();
  house();
 
}

//
void house(){
  //Draws a house
  fill(222,20,45);
  rect(400,220,150,150);
  triangle(380, 230, 470, 150, 580, 230);
}


//
void scene() {
  //Sky, and Grass
  background(3, 236, 255);
  fill(0, 129, 25);
  rect(-1, 200, 601, 200);
  fill(0);
 
  //Sun
  fill(247, 224, 10 );
  noStroke();
  ellipse(frameCount, height/6, 25,25);
 
 
 
  //Title Author
  fill(0);
  text("Project 1", 200,10);
  text("  Kweku Cush (9-13-13)", 20,height-20);
}



/////
void hero() {
  // Head
  fill(252, 179, 105);
  ellipse(mouseX, mouseY, 40, 40);
  stroke(0);
  //Body
  line(mouseX, mouseY+20, mouseX, mouseY+70);
  // Arms
  line(90, 90, 110, 100);
  line(110, 100, 130, 70);
  line(90, 90, 65, 95);
  line(65, 95, 50, 120);
  // Legs
  line(90, 120, 125, 135);
  line(125, 135, 110, 160);
  line(90, 120, 85, 150);
  line(85, 150, 50, 140);
  //Shoes
  fill(0);
  rect(50, 140, 10, 20);
  rect(110, 160, 20, 10);
 
   //Name
   fill(0,0,255);
   text("PED", mouseX-10,mouseY-10);
}




/////
void eyes() {
  //eyes
  fill(255);
  ellipse( mouseX-10, mouseY-0, 12,12);
  ellipse( mouseX+10, mouseY-0, 12,12);
  fill(0,0,255);
  ellipse( mouseX-9-random(2), mouseY-0, 8,8);
  ellipse( mouseX+9-random(2), mouseY-0, 8,8);
 
}



////
void keyPressed() {
  eyes();
  if (key=='e') {
    eyes();
  }
 
  if (key=='q') {
    exit();
  }
 
}
