// Jisoo Geum
// Section B
// jgeum@andrew.cmu.edu
// Project-02
var eyeWidth = 35;
var eyeHeight = 70;
var faceWidth = 220;
var faceHeight = 220;
var mouthWidth = 10;
var mouthHeight = 10;
var bubbleOnex = 185;
var bubbleOney = 140;
var bubbleThreex = 290;
var bubbleThreey = 110;
var soapouterR = 252;
var soapouterB = 193;
var soapouterG = 204;
var soapinnerR = 252;
var soapinnerB = 207;
var soapinnerG = 204;
function setup() {
createCanvas(640, 480);
background(249, 240, 255);
}
function draw() {
ellipseMode(CENTER);
//face
noStroke();
fill(207,231,235);
rect(121.859,189.318, faceWidth, faceHeight, 50); //body or face
ellipse (242.65,333.46, 281.586, 120.819); //arm
//eyes
fill(132,156,185);
stroke (255);
strokeWeight(9);
ellipse(224.87,324.63,eyeWidth, eyeHeight); //left eye
ellipse(286.56,324.63,eyeWidth, eyeHeight); //right eye
//mouth
noStroke();
fill(243,141,154);
ellipse(255.94, 376.31,mouthWidth,mouthHeight);
//soap
fill(soapouterR,soapouterB,soapouterG); // soap RBG
rect(383.44,269.56,52.33,90.693,20); //the outer shape
fill(soapinnerR,soapinnerG,soapinnerB);
ellipse(410,315.11,20,55); //the inner shape
//bubbles
stroke(132,156,185);
fill(255);
ellipse(bubbleOnex,bubbleOney,22,22); //bubbleOne
ellipse(232,150,18,18); //bubbleTwo
ellipse(bubbleThreex,bubbleThreey,30,30); //bubbleThree
ellipse(315,165,15,15); //bubbleFour
//text
noStroke();
fill(132,156,185);
textSize(48);
textStyle(NORMAL);
text ('Soap', 450, 200);
}
function mousePressed() {
eyeWidth = random(20, 65);
eyeHeight = random (20, 80);
mouthWidth = random (10,50);
bubbleOnex = random (80,185);
bubbleOney = random (100,150);
bubbleThreex = random (100,400);
bubbleThreey = random (50,200);
soapouterR = random (200,255);
soapouterB = random (180,255);
soapouterG = random (190,255);
soapinnerR = random (200,255);
soapinnerB = random (180,255);
soapinnerG = random (190,255);
}
I began drawing various emotions in my sketchbook and illustrator. When I began coding, I realized that I wasn’t able to transcribe those images with my current abilities. I ended up simplifying the design. Overall, the project was enjoyable although it was more challenging.