xxxxxxxxxx
61
let xLeft = 160;
let xRight = 240;
let y = 180;
let nextSmile = 0;
let patternValue = 100000;
function setup() {
createCanvas(500, 500);
ellipseMode(CENTER);
background(252, 223, 3);
for (let i = 0; i < 50; i++) {
let x = random(width);
let y = random(height);
let r = 50;
fill(245);
ellipse(x, y, r * 2, r * 2);
fill(random(80, 255), random(80, 255), random(100, 255));
circle(random(x - 8, x + 8), random(y - 10, y + 10), 50);
fill(0);
circle(random(x - 3, x + 3), random(y - 3, y + 3), 25);
fill(255);
circle(x, y - 5, 5);
//let a=color(random(255,100));
}
}
//function Eye() {
function draw() {
if (mouseX > 0 && mouseX < width && mouseY > 0 && mouseY < height) {
// Map the mouse location to the location of the pupils
xLeft = map(mouseX, 120, 200, 150, 170, true);
xRight = map(mouseX, 200, 280, 230, 250, true);
y = map(mouseY, 140, 220, 170, 190, true);
} else {
// If the mouse is off the canvas, look straight ahead
xLeft = 250;
xRight = 250;
y = 180;
if (frameCount % 60 == 0) {
patternValue = random(1000000);
randomSeed(patternValue);
}
}
function mousePressed() {
patternValue = random(1000000);
// }
}
}