xxxxxxxxxx
27
function setup() {
createCanvas(400, 400);
}
function draw() {
background(220);
let r = 255; // Always full red
let g = map(mouseY, 0, height, 255, 165);
let b = 0
//I'm going for a face that changes from "Happy" to "Mad"
fill(r, g, b); // Color changes based on mouse position
circle(200, 200, 350); // Centered circle
fill (0)
circle (100, 200, 50);
circle (300, 200, 50);
// Mouth Shape ( Used CHATGPT to help with this a bit, as I couldnt figure out how to get this JUST right, or rather how I envisioned, PROMPT was "Help me make a mouth that transitions into a smile when moving the mouse up and a frown when moving it down")
noFill();
stroke(0);
strokeWeight(5);
let mouthY = 260;
let smileToFrown = map(mouseY, 0, height, 0, PI); // direction of mouth
arc(width * 0.5, mouthY, 100, 50, smileToFrown, PI - smileToFrown);
}