Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
void setup(){
  size(400,400);
  frameRate(30);
}

void draw(){
  
  //Bakcground Colour
  noStroke();
  colorMode(HSB);
  background(160, 120,3 + 180);
  fill(170, 120,3 + 180);
  rect(0, 140, 400, 200);
  fill(175, 120,3 + 180);
  rect(0, 160, 400, 200);
  fill(180, 120,3 + 180);
  rect(0, 180, 400, 200);
  fill(185, 120,3 + 180);
  rect(0, 200, 400, 400);
  fill(190, 120,3 + 180);
  rect(0, 220, 400, 400);
  fill(190, 120,3 + 180);
  rect(0, 240, 400, 400);
  fill(200, 120,3 + 180);
  
  //Sparkles in the Background
  //Appears when mouse is moved
  colorMode(RGB);
  stroke(255,255,255,mouseY/2);
  strokeWeight(2);
  point(35, 80);
  point(55, 150);
  point(60, 50);
  point(110, 170);
  point(120, 150);
  point(150, 20);
  point(180, 150);
  point(175, 70);
  point(230, 40);
  point(280, 120);
  point(290, 30);
  point(320, 50);
  point(352, 160);
  point(370, 100);
  point(380, 140);
  point(190, 270);
  point(35, 280);
  point(155, 150);
  point(60, 350);
  point(110, 170);
  point(120, 150);
  point(150, 20);
  point(230, 340);
  point(280, 120);
  point(290, 135);
  point(320, 250);
  point(352, 165);
  
  //Panda Head moves with mouse
  
  //Ears
  fill(0);
  ellipseMode(CENTER);
  ellipse(120,80,70,60);
  ellipse(260,80,70,60);
  
  //Head
  stroke(0);
  fill(255);
  ellipseMode(CENTER);
  ellipse(190,120,190,120);
  
  //Nose
  fill(0);
  ellipseMode(CENTER);
  ellipse(190,140,20,10);
  line(190,145,185,155);
  line(190,145,195,155);

  //Eyes
  fill(mouseX/2,0,mouseY/2);
  ellipseMode(CENTER);
  ellipse(130,120,20,20);
  ellipse(250,120,20,20); 
  
}