Your browser does not support the canvas tag.

previous        Show / Hide Source        Download        next
/* Assignment 1: Interactive Drawing
Kristy Lin
"LET HIM EAT!" */

/* Premise:
You're able to move the mouse around, and depending on where
the mouse is located, their hands will move alone with the 
curcor as well. Clicking the mouse will make the person's mouth
close, and depending how close the cursor is to their moouth, it
should close aroun the food and hand as well. */

/*General Setup
No strokes because most of these are made up of different basic
shapes, and stroks will kinda ruin that. IE. the Fried Egg was just
threee circles.*/
void setup() {
  size(400,400);
  noStroke();
}

//The drawing
void draw() {
  noStroke();
  ellipseMode(CENTER);
  
  //Had to set a framerate because mousepressed had a set framerate
  frameRate(60);
  
  /*Background
  I wanted the kiddish feel, so I went with a more vibrant 
  lime green. there's alos gonna be various foods littered
  about the background to follow the theme. Decided to make
  it interactible by changing saturation and slight hue in
  relation with the cursor.*/
  background(157-mouseX/25,255-mouseY/5,170-mouseX/5);
  
  //Head backdrop
  fill(#ADFF9D);
  ellipse(200,400,300,300);
  
  /*Food backdrop
  Thisis mostly just so it doesn't look like straigth up
  floating food I guess. Personal preference really.*/
  fill(157-mouseX/5,255-mouseY/25,170-mouseX/25,159);
  ellipse(60,65,120,120);
  ellipse(190,65,120,120);
  ellipse(320,65,120,120);
  ellipse(90,200,130,130);
  ellipse(288,200,130,130);
  
  
  //Fried Egg (Whites)
  fill(255);
  ellipse(65,65,60,60);
  ellipse(45,75,40,40);
  //Yolk
  fill(#FFEB4D);
  ellipse(65,65,25,22);
  fill(#FDFF9D);
  ellipse(62,62,5,5); //Egg shine
  
  //Cookie (Light brown)
  fill(#F0B266);
  ellipse(190,80,80,40);
  //Chocolate chips!!!
  fill(#5D3F1A);
  ellipse(170,80,5,5);
  ellipse(190,70,3,3);
  ellipse(200,90,4,4);
  ellipse(210,80,5,5);
  ellipse(185,85,3,3);
  
  //Popsickle
  rectMode(CENTER); //just to keep things simple
  //Stick
  fill(#F5B96F);
  rect(320,98,10,20);
  //Flavouring???
  fill(#FF2168);
  ellipse(320,40,40,40);
  rect(320,68,40,45);
  
  //Sandwich
  //Bread
  fill(#D1B57E);//Chrust
  quad(90,210,140,220,100,230,40,220);
  rectMode(CORNERS); //Just to keep things simple
  rect(40,215,140,220);
  fill(#FFF2A7);
  quad(90,205,140,215,100,225,40,215);
  //Lettuce
  fill(#56E844);
  triangle(38,202,50,200,55,212);
  triangle(45,218,50,200,75,210);
  triangle(80,220,50,210,90,210);
  triangle(80,230,110,220,80,200);
  triangle(90,220,120,230,115,200);
  triangle(110,215,135,222,135,200);
  //Tomato
  fill(#DB1616);
  ellipse(90,200,85,28);
  fill(#FC2626);
  ellipse(90,197,85,20);
  //Bread
  fill(#D1B57E);//Chrust
  quad(90,185,140,195,100,205,40,195);
  rectMode(CORNERS); //Just to keep things simple
  rect(40,190,140,195);
  fill(#FFF2A7);
  quad(90,180,140,190,100,200,40,190);
  
  //Pancakes!
  //Plate
  fill(255); //easy white
  ellipse(285,228,120,30);
  //Actualy pancakes!
  ellipseMode(CENTER);
  fill(#F0BF77); //Edge colours
  ellipse(285,221,80,23);
  fill(#FFD698); //Top colours
  ellipse(285,218,80,20);
  fill(#F0BF77);
  ellipse(285,212,80,23);
  fill(#FFD698);
  ellipse(285,209,80,20);
  fill(#F0BF77); 
  ellipse(285,203,80,23);
  fill(#FFD698);
  ellipse(285,200,80,20);
  //Butter!
  fill(#FCF67A);
  rectMode(CORNER);
  rect(280,195,10,8);
  
  //HERE WE GO WITH THE BOY!
  
  //Cursor settings!
  //Hand
  //Palm
  fill(#EDC97A); //skin colour
  ellipse(+1+mouseX,-4+mouseY,55,65);
  //Fingers!
  ellipse(mouseX,-45+mouseY,11,50);
  ellipse(+13+mouseX,-38+mouseY,11,50);
  ellipse(-13+mouseX,-38+mouseY,11,50);
  ellipse(+25+mouseX,-27+mouseY,10,50);
  ellipse(-30+mouseX,-10+mouseY,40,12);
  //Forarm that follows hand
  quad(-15+mouseX,mouseY,+15+mouseX,mouseY,380,400,350,400);
  
  //skin
  fill(#EDC97A);
  ellipse(200,400,250,250);
  //nose
  fill(#EDC97A);
  ellipse(200,275,30,30);
  //ears
  fill(#EDC97A);
  ellipse(80,400,50,50);
  ellipse(320,400,50,50);
  //mouth stuff
  fill(#F26762);
  ellipse(200,410,150,150);
  fill(#DE4A45);
  ellipse(192,400,20,20);
  ellipse(208,400,20,20);
  //teeth!
  fill(255);
  ellipse(150,390,20,20);
  ellipse(250,390,20,20);
  ellipse(160,370,15,15);
  ellipse(240,370,15,15);
  ellipse(175,355,15,15);
  ellipse(225,355,15,15);
  ellipse(192,348,15,10);
  ellipse(208,348,15,10);
  
}

void mousePressed() {
  /*Clicking settings!
  Basically just makes the person's mouth
  close when click*/
  noStroke();
  //Makes it linger a bit, so you can actually see it close
  frameRate(8);
  //Erasing mouth
  fill(#EDC97A);
  ellipse(200,400,250,250);
  //Lips
  fill(#E34640);
  ellipse(200,380,150,7);
}