/******************************************************************
* File Name: Tehcnologic Daft Punk Robot
* Author: Nima Gholipour
* Student number:991391215
* Date: September 19, 2016
* Description: This is an interactive drawing based on the robot
in the daft punk technologic music video.
* Bring the mouse below the robots head so that is expression changes
and his mouth will open and say a quote from the music video.
* The eyes will also turn red and follow where ever the mouse goes
******************************************************************/
void setup() {
//Set Size
size(400, 400);
ellipseMode(CENTER);
rectMode(CENTER);
smooth();
}
void draw() {
noStroke();
background(255);
//Red Room
//back wall
fill(179, 18, 18);
rect(200, 200, 240, 280);
//left side wall
fill(187, 32, 32);
quad(0, 0, 80, 50, 80, 340, 0, 400);
//right side wall
fill(187, 32, 32);
quad(320, 50, 320, 340, 400, 400, 400, 0);
//floor
fill(173, 4, 4);
quad(0, 400, 80, 320, 320, 320, 400, 400);
//ceilling
fill(173, 4, 4);
quad(0, 0, 80, 60, 320, 60, 400, 0);
//head
fill(244, 239, 218);
ellipse(200, 200, 160, 160);
//Face
fill(0);
rect(200, 180, 110, 40);
//nose
fill(244, 239, 218);
rect(200, 195, 30, 10);
//eyes
fill(255);
ellipse(165, 182, 32, 32);
ellipse(235, 182, 32, 32);
//Pupils
stroke(0);
strokeWeight(4);
fill(255, 0, 0, 0+mouseY/1);
ellipse(155+mouseX/22, 175+mouseY/25, 12, 12);
ellipse(225+mouseX/22, 175+mouseY/25, 12, 12);
//eyebrows
noStroke();
strokeWeight(1);
fill(139, 139, 139);
rect(235, 160+mouseY/27, 50, 20);
rect(165, 160+mouseY/27, 50, 20);
//mouth
//Cheek Gap
fill(0);
quad(145, 260, 200, 210, 255, 260, 200, 295);
//Upper jaw
fill(255, 158, 126);
rect(200, 220, 40, 20);
//Upper Teeth
stroke(0);
fill(255);
rect(200, 235, 30, 10);
//Lower Teeth
fill(255);
rect(200, 245+mouseY/23, 30, 10);
//chin
fill(244, 239, 218);
noStroke();
triangle(145, 260+mouseY/23, 200, 295+mouseY/23, 255, 260+mouseY/23);
//Lower jaw
noStroke();
fill(255, 158, 126);
rect(200, 260+mouseY/23, 40, 20);
//Speech Bubble
fill(255, 255, 255, 0+mouseY/1.5);
triangle(280, 280, 310, 300, 280, 340);
rect(310, 320, 110, 50);
//Speech
//"b"
fill(0, 0, 0, 0+mouseY/1.5);
rect(270, 317, 5, 28);
rect(277, 312, 12, 5);
rect(282, 320, 5, 20);
rect(277, 328, 12, 5);
//"u"
rect(290, 320, 5, 20);
rect(294, 328, 12, 5);
rect(298, 320, 5, 20);
//"y"
rect(306, 320, 5, 20);
rect(310, 328, 12, 5);
rect(314, 320, 5, 20);
rect(314, 330, 5, 15);
rect(310, 335, 12, 5);
//"i"
rect(329, 320, 5, 20);
ellipse(329, 306, 5, 5);
//"t"
rect(339, 314, 5, 33);
rect(339, 306, 12, 5);
}