Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next



/* 
This program is about a cat dreaming, that follows the treat around with its eyes, as 
he's doing it  the background changes to mimic that cat  being in some kinda 
psychedelic stance and he really wants the treat.

The insperation of this program came from my cat, bause evertime I take out the treats
his eyes always follow that treats and hes really happy to eat them . 

*/

void setup() {
  
  size(400, 400);
  
  rectMode(CENTER);
  ellipseMode(CENTER);
  
}

void draw()  {
  
  background(255, 255, 255);
  
  strokeWeight(2);
  
  // Changing background

  fill(mouseX, 25, mouseY);
  noStroke();
  rect(200, 20, 400, 40);
  
  fill(mouseX, 50, mouseY);
  noStroke();
  rect(200, 60, 400, 40);
  
  fill(mouseX, 75, mouseY);
  noStroke();
  rect(200, 100, 400, 40);
  
  fill(mouseX, 100, mouseY);
  noStroke();
  rect(200, 140, 400, 40);
  
  fill(mouseX, 125, mouseY);
  noStroke();
  rect(200, 180, 400, 40);
  
  fill(mouseX, 150, mouseY);
  noStroke();
  rect(200, 220, 400, 40);
  
  fill(mouseX, 175, mouseY);
  noStroke();
  rect(200, 260, 400, 40);
  
  fill(mouseX, 200, mouseY);
  noStroke();
  rect(200, 300, 400, 40);
  
  fill(mouseX, 225, mouseY);
  noStroke();
  rect(200, 340, 400, 40);
  
  fill(mouseX, 250, mouseY);
  noStroke();
  rect(200, 380, 400, 40);
  
  // ear left
  fill(245, 150, 7);
  noStroke();
  triangle(200, 120, 130, 190, 90, 30);
  
  fill(79, 48, 2);
  noStroke();
  triangle(160, 120, 140, 160, 110, 60);
  
  // ear right
  fill(245, 150, 7);
  noStroke();
  triangle(230, 110, 290, 190, 330, 30);
  
  fill(79, 48, 2);
  noStroke();
  triangle(260, 120, 280, 160, 310, 60);
  
  // face
  
  fill(245, 150, 7);
  noStroke();
  ellipse(210, 200, 230, 200);
  
  fill(79, 48, 2);
  noStroke();
  ellipse(210, 260, 100, 60);
  
  
  // mouth
  
  stroke(0, 0, 0);
  line(210, 250, 210, 270);
  arc(205, 270, 10, 10, 0, PI);
  arc(215, 270, 10, 10, 0, PI);
  
  // nose
  
  fill(227, 118, 169);
  noStroke();
  arc(210, 250, 20, 20, 0, PI); 
  
  // whiskers
  stroke(0, 0, 0);
  line(190, 250, 160, 230);
  stroke(0, 0, 0);
  line(190, 260, 160, 260);
  stroke(0, 0, 0);
  line(190, 270, 160, 290);
  stroke(0, 0, 0);
  line(230, 250, 260, 230);
  stroke(0, 0, 0);
  line(230, 260, 260, 260);
  stroke(0, 0, 0);
  line(230, 270, 260, 290);
  stroke(0, 0, 0);
  
  // Fur
  
  fill(79, 48, 2);
  noStroke();
  ellipse(165, 190, 40, 80);
  
  fill(79, 48, 2);
  noStroke();
  ellipse(255, 190, 40, 80);
  
  // Eye
  
  fill(255, 255, 255);
  noStroke();
  ellipse(165, 190, 30, 60); 
  
  fill(255, 255, 255);
  noStroke();
  ellipse(255, 190, 30, 60); 
  
  // Pupils
  
  fill(67, 130, 232);
  ellipse(165 + (mouseX / 100), 190 + (mouseY / 40), 25, 25);
  
  fill(67, 130, 232);
  ellipse(255 + (mouseX / 100), 190 + (mouseY / 40), 25, 25);
  
  fill(0, 0, 0);
  ellipse(165 + (mouseX / 100), 190 + (mouseY / 40), 15, 15);
  
  fill(0, 0, 0);
  ellipse(255 + (mouseX / 100), 190 + (mouseY / 40), 15, 15);
  
  // Treat
  
  fill(64, 46, 13);
  noStroke();
  rect(mouseX, mouseY, 20, 20);
 
  fill(140, 103, 34);
  noStroke();
  rect(mouseX, mouseY, 15, 15);
  
  fill(64, 46, 13);
  noStroke();
  rect(mouseX, mouseY, 10, 10);
  

  
   

}

// Cat talking

void mousePressed()  {
  
  println(" Meow, gimme treat plzzz ");
  
}