xxxxxxxxxx
29
function setup() {
createCanvas(400, 400);
}
function draw() {
background(0);
var x = 0;
var y = 0;
while (y < height) {
while (x < width) {
fill('yellow');
ellipse(x + 50, y + 50, 50);
// eyes
var Xshift = map(mouseX-x, 0, width, 0, 20);
var Yshift = map(mouseY-y, 0, height, 0, 20);
fill(0);
ellipse(x + 45 + Xshift, y + 45 + Yshift, 5, 10);
ellipse(x + 55 + Xshift, y + 45 + Yshift, 5, 10);
noFill();
arc(x + 50, y + 50, 30, 30, 0, PI, OPEN);
x = x + 75;
}
y = y + 75;
x = 0;
}
fill(255,0,0);
ellipse(mouseX,mouseY,20);
}