/* built with Studio Sketchpad:
* https://sketchpad.cc
*
* observe the evolution of this sketch:
* https://bard117f12.sketchpad.cc/sp/pad/view/ro.FTcbfSZs9uI/rev.329
*
* authors:
* Ally Smith
* license (unless otherwise specified):
* creative commons attribution-share alike 3.0 license.
* https://creativecommons.org/licenses/by-sa/3.0/
*/
/*This sketch uses ellipses, rectangles, and lines to create a face. In this way it is similar to my designblocks portrait. However, I use HSB rather than RGB color in this design. Also, the eyes in this portrait respond to the mouse's movement, looking left or right. My designblocks portrait was not interactive. The main difference that makes this design interactive is the use of variables - mouseX and and mouseY - along with the use of "void setup" and "void draw".*/
int L, R;
void setup(){
size(600,600);
smooth();
colorMode(HSB, 360, 100, 100);
rectMode(CENTER);
frameRate(60);
}
void draw() {
background(275, 69, 79);
noStroke();
fill(33, 44, 91);
ellipse(300, 300, 300, 400);
fill(33, 0, 99);
stroke(0);
ellipse(230, 290, 80, 40);
ellipse(370, 290, 80, 40);
//hair
noStroke();
fill(31, 79, 62);
ellipse(300, 170, 340, 140);
rect(150, 300, 38, 278);
rect(450, 300, 38, 278);
//nose
fill(0);
rect(300, 380, 30, 5);
stroke(0);
line(285, 380, 300, 280);
//mouth
noStroke();
fill(344, 96, 42);
ellipse(290, 427, 50, 30);
ellipse(310, 427, 50, 30);
ellipse(300, 430, 60, 30);
//moving eyes
noStroke();
fill(33, 63, 23);
L = mouseX;
R = mouseX + 140;
L = constrain (L, 210, 250);
R = constrain (R, 350, 390);
ellipse(L, 290, 30, 30);
ellipse(R, 290, 30, 30);
}