variable_faces
var backgroundRed = 195;
var backgroundGreen = 227;
var backgroundBlue = 255;
var drinkColorRed = 215;
var drinkColorGreen = 159;
var drinkColorBlue = 117;
var drinkColorInt = 0;
var strawColorRed = 255;
var strawColorGreen = 166;
var strawColorBlue = 255;
var bubbleRadius = 25;
var expressionControl = 400;
function setup() {
createCanvas(600, 600);
}
function draw() {
background(backgroundRed, backgroundGreen, backgroundBlue);
noStroke();
fill(backgroundRed - 30, backgroundGreen - 30, backgroundBlue - 30);
rect(0, 460, 600, 140);
noStroke();
fill(backgroundRed - 75, backgroundGreen - 75, backgroundBlue - 75);
quad(200, 500, 400, 500, 425, 600, 175, 600);
stroke(255);
strokeWeight(4);
fill(drinkColorRed - drinkColorInt, drinkColorGreen - drinkColorInt, drinkColorBlue - drinkColorInt);
arc(300, 500, 200, 50, 0, PI, OPEN);
noStroke();
fill(drinkColorRed - drinkColorInt, drinkColorGreen - drinkColorInt, drinkColorBlue - drinkColorInt);
quad(200, 500, 185, 320, 415, 320, 400, 500);
noStroke();
fill(drinkColorRed - drinkColorInt - 30, drinkColorGreen - drinkColorInt - 30, drinkColorBlue - drinkColorInt - 30);
ellipse(300, 320, 230, 50);
stroke(255);
strokeWeight(4);
noFill();
arc(300, 200, 250, 50, PI, 0, OPEN);
noStroke();
fill(strawColorRed, strawColorGreen, strawColorBlue);
rect(285, 150, 30, 170);
noStroke();
fill(strawColorRed, strawColorGreen, strawColorBlue);
arc(300, 320, 30, 10, 0, PI, OPEN);
noStroke();
fill(strawColorRed - 30, strawColorGreen - 30, strawColorBlue - 30);
ellipse(300, 150, 30, 10);
stroke(255);
strokeWeight(4);
line(200, 500, 175, 200);
stroke(255);
strokeWeight(4);
line(400, 500, 425, 200);
stroke(255);
strokeWeight(4);
noFill();
arc(300, 200, 250, 50, 0, PI, OPEN);
noStroke();
fill(0);
ellipse(250, 380, 15);
noStroke();
fill(0);
ellipse(350, 380, 15);
stroke(0);
strokeWeight(2);
point(285, 390);
point(300, expressionControl);
point(315, 390);
strokeWeight(2);
noFill();
beginShape();
curveVertex(285, 390);
curveVertex(285, 390);
curveVertex(300, expressionControl);
curveVertex(315, 390);
curveVertex(315, 390);
endShape();
noStroke();
fill(0);
ellipse(225, 493, bubbleRadius);
ellipse(255, 501, bubbleRadius);
ellipse(285, 505, bubbleRadius);
ellipse(315, 505, bubbleRadius);
ellipse(345, 501, bubbleRadius);
ellipse(375, 493, bubbleRadius);
ellipse(218, 465, bubbleRadius);
ellipse(250, 473, bubbleRadius);
ellipse(283, 477, bubbleRadius);
ellipse(317, 477, bubbleRadius);
ellipse(350, 473, bubbleRadius);
ellipse(380, 465, bubbleRadius);
}
function mousePressed() {
backgroundRed = random(150, 255);
backgroundGreen = random(150, 255);
backgroundBlue = random(150, 255);
drinkColorInt = random(0,100);
strawColorBlue = random(0,255);
bubbleRadius = random(17,27);
expressionControl = random(380,400);
}
This project was a really fun way to experiment with changing shapes. I enjoyed testing some new functions as well. I struggled a bit with not compromising the aesthetic integrity of the piece while still allowing there to be perceptible variations in color and size, but I’m happy with how it turned out.