> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://cisc1600.sketchpad.cc/sp/pad/view/ro.MizI-LPbBO8/rev.2636
 * 
 * authors: 
 *   Richard Basulto
 *   benedah
 *   jarvis gu

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



/****This project is a simple animation of a face. Everytime the user holds the left mousebutton lasers shoot 
out of the pupil until the user releases the mouse button, when the user presses the right or center mousebutton
the background refreshes and the lasers disappear.***/


int i=0;
void setup(){
size(800, 500); 
background(random(255),random(255),random(255));//the background will change color every time it is refreshed
} 

void draw() { 
    strokeWeight(4);
    //Cornea
    fill(255);
    stroke(0);
    ellipse(400,250,width/2,height/2);
   
    //iris
    fill(random(255),random(255),random(255));
    ellipse(400,250,width/4,height/4);

    //pupil
    
    fill(0);
    ellipse(400,250,width/8,height/8);

    //eyebrow
    fill(45,96,35)
    triangle(400,90,150,100,650,100);
    
    //Mouth
    fill(255,0,0)
    rect(200,395,400,75);
    
    //teeth color
    fill(255);
    
    //top teeth 
    
    rect(200,395,10,20);
    rect(220,395,10,30);
    rect(240,395,10,20);
    rect(260,395,10,30);
    rect(280,395,10,20);
    rect(300,395,10,30);
    rect(320,395,10,20);
    rect(340,395,10,30);
    rect(360,395,10,20);
    rect(380,395,10,30);
    rect(400,395,10,20);
    rect(420,395,10,30);
    rect(440,395,10,20);
    rect(460,395,10,30);
    rect(480,395,10,20);
    rect(500,395,10,30);
    rect(515,395,10,20);
    rect(530,395,10,30);
    rect(550,395,10,20);
    rect(570,395,10,30);
    rect(590,395,10,20);
    
    //bottom teeth
    
    rect(200,440,10,30);
    rect(220,450,10,20);
    rect(240,440,10,30);
    rect(260,450,10,20);
    rect(280,440,10,30);
    rect(300,450,10,20);
    rect(320,440,10,30);
    rect(340,450,10,20);
    rect(360,440,10,30);
    rect(380,450,10,20);
    rect(400,440,10,30);
    rect(420,450,10,20);
    rect(440,440,10,30);
    rect(460,450,10,20);
    rect(480,440,10,30);
    rect(500,450,10,20);
    rect(515,440,10,30);
    rect(530,450,10,20);
    rect(550,440,10,30);
    rect(570,450,10,20);
    rect(590,440,10,30);


 //if statement for the laserbeams
    if (mousePressed==true){
     if(mouseButton==LEFT){
        stroke(random(255),random(255),random(255));
        strokeWeight(4);
        line(400,250,200,500);
        line(400,250,220,2);
        line(400,250,240,450);
        line(400,250,260,320);
        line(400,250,260,300);
        line(400,250,280,45);
        line(400,250,300,40);
        line(400,250,320,89);
        line(400,250,340,420);
        line(400,250,360,425);
        line(400,250,380,365);
        line(400,250,400,65);
        line(400,250,420,0);
        line(400,250,440,34);
        line(400,250,460,198);
        line(400,250,480,154);
        line(400,250,500,60);
        line(400,250,520,50);
        line(400,250,540,150);
        line(400,250,560,340);
        line(400,250,580,270);
        line(400,250,600,350);
        line(400,250,200,400);
        line(400,250,220,2);
        line(400,250,240,235);
        line(400,250,260,32);
        line(400,250,260,289);
        line(400,250,280,145);
        line(400,250,300,240);
        line(400,250,320,89);
        line(400,250,340,320);
        
        }
       else{
            background(random(255),random(255),random(255));//press either the right button or center mouse button to refresh  the background
            
        }

           } 
}