Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup() {
  //set up the size of the background
  size (400,400);
}

void draw() {
  //Draw a light grey background
  background(200);
  
  //set Center mode
  ellipseMode(CENTER);
  //rectMode(CENTER);
  
  //get rid of stroke around shapes
  noStroke();
  
  //add "floor"
  fill(180);
  rect(0, 300, 400, 400);
  
  //shadow
  fill(150);
  ellipse(200, 360, 180, 60);
  //body colour
  fill(0);
  
  //draw body
  ellipse(200, 300, 100, 120);
  
  //draw hind legs
  ellipse(160, 320, 80, 80);
  ellipse(240, 320, 80, 80);
  
  //draw ears
  ellipse(160, 150, 40, 80);
  ellipse(240, 150, 40, 80);
  //inner ear
  fill(255, 200, 200);
  ellipse(160, 150, 20, 40);
  ellipse(240, 150, 20, 40);
  
  //draw head
  fill(0);
  ellipse(200, 200, 140, 140);
  
  //paws  
  //draw front paws
  fill(50);
  ellipse(180, 360, 40, 40);
  ellipse(220, 360, 40, 40);
  //draw hind paws
  fill(30);
  ellipse(140, 350, 40, 40);
  ellipse(260, 350, 40, 40);
  
  //draw schlera
  fill(255);
  ellipse(170, 200, 40, 40);
  ellipse(230, 200, 40, 40);
  
  //Draw pupils (follow cursor)
  fill(0);
  ellipse(150 + mouseX/10, 190 + mouseY/20, 10, 40);
  ellipse(210 + mouseX/10, 190 + mouseY/20, 10, 40);
}

void mousePressed() {
  //eyelids
  fill(30);
  ellipse(170, 200, 40, 40);
  ellipse(230, 200, 40, 40);
  
  println("mao");
}