> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://bard117s14.sketchpad.cc/sp/pad/view/ro.7O1DU2zQ3hh/rev.259
 * 
 * authors: 
 *   Jeff Rossen

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "Self Portrait II", created by Keith O'Hara
// http://bard117s14.sketchpad.cc/sp/pad/view/ro.AfNeVls4vddifn/rev.71



//Jeff Rossen [email protected] 2/17/14
//Interactive self portrait
//The goal of this project was to create a new selfportrait using random(), and experimenting with interactive properties such as keypress and conditionals.  In my project I drew a representation of myself as a "projector" projecting my knowledge of programming onto the viewer.  When the viewer gets tired of my babbling, they can simply press a key and shut me up.  If you change your mind, just click the square!

void setup (){
  size (500,400);
  background (#FCFFFF);
  strokeWeight (3);
  smooth();
  textSize(20);
  
  
}
void draw(){
  fill (#FAD8A4);
  // head
  ellipse (250,150,200,200);
  //glasses
  //frames
  line (150,150,350,150);
  //outer frames
  ellipse (200,150,55,55);
  ellipse (300,150,55,55);
  //inner frames
  fill(255,255,255);
  ellipse (200,150,40,40);
  ellipse (300,150,40,40);
  //pupils
  fill(0,0,0);
  ellipse (200,150,10,10);
  ellipse (300,150,10,10);
  //mouth
  float g = random(50, 255);
    float r = random(0, 255);
    float b = random(200, 255);
    fill(g, b, r);
  ellipse (250,200,30,30);
  //hair
  fill(#BF8938);
   triangle(330,85, 250, 0, 175,80);
  //stand
  fill(120,120,120);
 rect(220,250,60,100);
 //button
 fill(255,0,0);
 rect(235,280,30,30);
 //Text
 fill(0,0,0);
 text("Press a button", 20,100);
 //text2
 text("to shut me up", 20,120);
 //text3
 fill(255,0,0);
 text("Click the square", 20, 300);
 //text4
 text("to make me talk", 20, 320);
}
 
 void keyPressed(){
 noLoop();
    fill(0,0,0);
  ellipse (250,200,30,30);
 }
void mousePressed(){
    if((mouseX > 235 && mouseX < 265)&&(mouseY > 285 && mouseY < 315)){
      loop();
   }
 }