Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup() {


  // set size of display
  size(400, 400);

}

void draw() {
  
  frameRate(60);

  // basic backround
    background(85, 69, 69); //REDISH
  

  // character chest
    fill(115);
    noStroke();
  
  
    //shading
    ellipseMode(CENTER);
    ellipse(130, 3*sin(frameCount/10.0)+140, 160, 80 );
  
  
    //light
    fill(135);
    ellipse(130,3*sin(frameCount/10.0)+132,150,60);
    
    
 //neck
    noStroke();
    fill(115);
    ellipseMode(CENTER);
    ellipse(110,3*sin(frameCount/10.0)+112,60,20);
    
    stroke(90);
    strokeWeight(15);
    line(80,60,108,3*sin(frameCount/10.0)+108);
   
   
  
  //Character Head
    fill(135);
    noStroke();
    ellipseMode(CENTER);
    ellipse(80, 60, 50, 80);
    
    
  //circle (midsection)
    fill(100);
    ellipseMode(CENTER);
    ellipse(2.5*sin(frameCount/10.0)+177,3*cos(frameCount/10.0)+200,40,40);
  
    fill(115);
    ellipseMode(CENTER);
    ellipse(2.5*sin(frameCount/10.0)+170,3*cos(frameCount/10.0)+195,20,20);
  
  
  //the eye!! moving bits
   stroke(88);
   strokeWeight(3);
   line(65,35,mouseX*0.0275+64,mouseY*0.0475+33);
  
   line(93,33,mouseX*0.035+87,mouseY*0.085+31);
   
   line(80,97,mouseX*0.045+71,mouseY*0.0675+66);
    
   fill(212,202,202);
   stroke(88);
   strokeWeight(3);
   ellipseMode(CENTER);
   ellipse(mouseX*0.0625+70, mouseY*0.095+38, 20, 27);
   
   stroke(255);
   strokeWeight(3);
   
  
    
  // the thumb.
    noStroke();
    fill(115);
    quad(280,3*sin(frameCount/10.0)+100,280,3*sin(frameCount/10.0)+135,240,3*sin(frameCount/10.0)+105,240,3*sin(frameCount/10.0)+80);
    triangle (240,3*sin(frameCount/10.0)+105,240,3*sin(frameCount/10.0)+80,200,3*sin(frameCount/10.0)+40);
    
    
  //Arms!! (i thought one would look cool)
  
    stroke(122);
    strokeWeight(17);
    line(220,3*sin(frameCount/10.0)+195,320,3*sin(frameCount/10.0)+220);
    
    noStroke();
    fill(122);
    quad(328,3*sin(frameCount/10.0)+227,310,3*sin(frameCount/10.0)+215,230,3*sin(frameCount/10.0)+40,300,3*sin(frameCount/10.0)+40);
    
    
   //fingers
    noStroke();
    
    //left
    fill(115);
    quad(230,3*sin(frameCount/10.0)+40,250,3*sin(frameCount/10.0)+40,245,3*sin(frameCount/10.0)+20,227,3*sin(frameCount/10.0)+20);
    fill(135);
    triangle(245,3*sin(frameCount/10.0)+20,227,3*sin(frameCount/10.0)+20,210,3*sin(frameCount/10.0)+80);
    
    //middle
    fill(115);
    quad(250,3*sin(frameCount/10.0)+40,280,3*sin(frameCount/10.0)+40,270,3*sin(frameCount/10.0)+20,250,3*sin(frameCount/10.0)+20);
    fill(135);
    triangle(270,3*sin(frameCount/10.0)+20,250,3*sin(frameCount/10.0)+20,245,3*sin(frameCount/10.0)+95);
    
    //right
    fill(115);
    quad(280,3*sin(frameCount/10.0)+40,300,3*sin(frameCount/10.0)+44,300,3*sin(frameCount/10.0)+20,285,3*sin(frameCount/10.0)+20);
    fill(135);
    triangle(300,3*sin(frameCount/10.0)+20,285,3*sin(frameCount/10.0)+20,292,3*sin(frameCount/10.0)+100);
    
    
  //legs
    noStroke();
    fill(135);
   
     //left
     triangle(140,3*sin(frameCount/10.0)+190,150,3*sin(frameCount/10.0)+240,60,1.5*sin(frameCount/10.0)+280);
    
    noStroke();
    fill(115);
    triangle(145,3*sin(frameCount/10.0)+215,150,3*sin(frameCount/10.0)+240,60,1.5*sin(frameCount/10.0)+280);
    
    fill(135);
    triangle(60,1.5*sin(frameCount/10.0)+280,100,1.5*sin(frameCount/10.0)+240,60,380); //shading
  
  
    //right
    fill(135);
    triangle(170,1.5*sin(frameCount/10.0)+240,200,1.5*sin(frameCount/10.0)+210,170,1.5*sin(frameCount/10.0)+320);
    
    fill(135);
    triangle(170,1.5*sin(frameCount/10.0)+320,175,1.5*sin(frameCount/10.0)+280,320,380);
    
    fill(115);
    triangle(170,1.5*sin(frameCount/10.0)+320,320,380,205,1.5*sin(frameCount/10.0)+320); //shading
   
   //detailing
   stroke(88);
   strokeWeight(3);
   noFill();
   curve(170,3*sin(frameCount/10.0)+98,150,3*sin(frameCount/10.0)+115,150,3*sin(frameCount/10.0)+166,170,3*sin(frameCount/10.0)+178);
   curve(170,3*sin(frameCount/10.0)+98,90,3*sin(frameCount/10.0)+115,90,3*sin(frameCount/10.0)+166,170,3*sin(frameCount/10.0)+178);
  
}


void mousePressed(){

  frameRate(3);

  println("PEW PEW");
  
  background(150, 85, 85);
  
   // character chest
    fill(135);
    noStroke();
  
  
    //shading
    ellipseMode(CENTER);
    ellipse(130, 3*sin(frameCount/10.0)+140, 160, 80 );
  
  
    //light
    fill(155);
    ellipse(130,3*sin(frameCount/10.0)+132,150,60);
    
    
 //neck
    noStroke();
    fill(135);
    ellipseMode(CENTER);
    ellipse(110,3*sin(frameCount/10.0)+112,60,20);
    
    stroke(110);
    strokeWeight(15);
    line(80,60,108,3*sin(frameCount/10.0)+108);
   
   
  
  //Character Head
    fill(155);
    noStroke();
    ellipseMode(CENTER);
    ellipse(80, 60, 50, 80);
    
    
  //circle (midsection)
    fill(120);
    ellipseMode(CENTER);
    ellipse(2.5*sin(frameCount/10.0)+177,3*sin(frameCount/10.0)+200,40,40);
  
    fill(135);
    ellipseMode(CENTER);
    ellipse(2.5*sin(frameCount/10.0)+170,3*sin(frameCount/10.0)+195,20,20);
  
  
  //the eye!! moving bits
   stroke(108);
   strokeWeight(3);
   line(65,35,mouseX*0.0275+64,mouseY*0.0475+33);
  
   line(93,33,mouseX*0.035+87,mouseY*0.085+31);
   
   line(80,97,mouseX*0.045+71,mouseY*0.0675+66);
    
   fill(230,100,100);
   stroke(108);
   strokeWeight(3);
   ellipseMode(CENTER);
   ellipse(mouseX*0.0625+70, mouseY*0.095+38, 20, 27);
    
  
    
    
  // the thumb.
    noStroke();
    fill(135);
    quad(280,3*sin(frameCount/10.0)+100,280,3*sin(frameCount/10.0)+135,240,3*sin(frameCount/10.0)+105,240,3*sin(frameCount/10.0)+80);
    triangle (240,3*sin(frameCount/10.0)+105,240,3*sin(frameCount/10.0)+80,200,3*sin(frameCount/10.0)+40);
    
    
  //Arms!! (i thought one would look cool)
  
    stroke(152);
    strokeWeight(17);
    line(220,3*sin(frameCount/10.0)+195,320,3*sin(frameCount/10.0)+220);
    
    noStroke();
    fill(152);
    quad(328,3*sin(frameCount/10.0)+227,310,3*sin(frameCount/10.0)+215,230,3*sin(frameCount/10.0)+40,300,3*sin(frameCount/10.0)+40);
    
    
   //fingers
    noStroke();
    
    //left
    fill(135);
    quad(230,3*sin(frameCount/10.0)+40,250,3*sin(frameCount/10.0)+40,245,3*sin(frameCount/10.0)+20,227,3*sin(frameCount/10.0)+20);
    fill(175);
    triangle(245,3*sin(frameCount/10.0)+20,227,3*sin(frameCount/10.0)+20,210,3*sin(frameCount/10.0)+80);
    
    //middle
    fill(135);
    quad(250,3*sin(frameCount/10.0)+40,280,3*sin(frameCount/10.0)+40,270,3*sin(frameCount/10.0)+20,250,3*sin(frameCount/10.0)+20);
    fill(175);
    triangle(270,3*sin(frameCount/10.0)+20,250,3*sin(frameCount/10.0)+20,245,3*sin(frameCount/10.0)+95);
    
    //right
    fill(135);
    quad(280,3*sin(frameCount/10.0)+40,300,3*sin(frameCount/10.0)+44,300,3*sin(frameCount/10.0)+20,285,3*sin(frameCount/10.0)+20);
    fill(175);
    triangle(300,3*sin(frameCount/10.0)+20,285,3*sin(frameCount/10.0)+20,292,3*sin(frameCount/10.0)+100);
    
    
  //legs
    noStroke();
    fill(155);
   
     //left
     triangle(140,3*sin(frameCount/10.0)+190,150,3*sin(frameCount/10.0)+240,60,1.5*sin(frameCount/10.0)+280);
    
    noStroke();
    fill(135);
    triangle(145,3*sin(frameCount/10.0)+215,150,3*sin(frameCount/10.0)+240,60,1.5*sin(frameCount/10.0)+280);
    
    fill(155);
    triangle(60,1.5*sin(frameCount/10.0)+280,100,1.5*sin(frameCount/10.0)+240,60,380); //shading
  
  
    //right
    fill(155);
    triangle(170,1.5*sin(frameCount/10.0)+240,200,1.5*sin(frameCount/10.0)+210,170,1.5*sin(frameCount/10.0)+320);
    
    fill(155);
    triangle(170,1.5*sin(frameCount/10.0)+320,175,1.5*sin(frameCount/10.0)+280,320,380);
    
    fill(135);
    triangle(170,1.5*sin(frameCount/10.0)+320,320,380,205,1.5*sin(frameCount/10.0)+320); //shading
    
  //detailing
  stroke(108);
  strokeWeight(3);
  noFill();
  curve(170,3*sin(frameCount/10.0)+98,150,3*sin(frameCount/10.0)+115,150,3*sin(frameCount/10.0)+166,170,3*sin(frameCount/10.0)+178);
  curve(170,3*sin(frameCount/10.0)+98,90,3*sin(frameCount/10.0)+115,90,3*sin(frameCount/10.0)+166,170,3*sin(frameCount/10.0)+178);
   

  //lazer 
  strokeWeight(4);
  stroke(194,21,21);
  line(mouseX*0.0625+70, mouseY*0.095+38,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(255);
  line(mouseX*0.0625+70, mouseY*0.095+38,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX-20,mouseY-20,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX-5,mouseY-10,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX+20,mouseY-20,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX+5,mouseY-10,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX+20,mouseY+20,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX+5,mouseY+10,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX-20,mouseY+20,mouseX,mouseY);
  
  strokeWeight(1);
  stroke(194,21,21);
  line(mouseX-5,mouseY+10,mouseX,mouseY);
  
   
}