xxxxxxxxxx
84
var huer;
var x1 = 30;
var y1 = 70;
var x, y;
//var rr;
function setup() {
createCanvas(600, 500);
rr = random(0,255);
huer = 0;
}
function draw()
{
background(100);
textSize(20)
text("X = " + mouseX,50,50)
text("Y = " + mouseY,50, 80)
for(let i = 0; i <10; i ++){
for(let j = 0; j <10; j++){
let scalee = random(0.5,2);
eye(i * 120, j * 120, 1)
}
}
}
function eye(a, b, sc) {
if (huer > 360) {
huer = 0;
} else {
huer = huer + .05;
}
colorMode(HSL, 360);
stroke(0);
fill(huer, 200, 200);
stroke(0);
strokeWeight(6);
ellipse(a,b,100); // EYEBALL
fill(0);
ellipse(a,b, x1) // PUPIL
if (x1 < 70) {
x1 = x1 + .05
}
else if (x1 >= 70)
x1 = -x1
fill(300);
noStroke();
ellipse((a)-22, b, 15) // LIGHT
colorMode(RGB) ;
fill(6, 84, 71);
noStroke();
if (mouseX > a - (50 * sc) && mouseX < a + (50 * sc) && mouseY > b - 50 * sc && mouseY < b + (50 * sc))
ellipse(a,b,110, 110);
}