xxxxxxxxxx
25
let spaceX = 20, spaceY = 20, diam = 40;
function setup() {
createCanvas(600, 600);
noStroke();
}
function draw() {
background(0);
for (let x = 20; x < width; x += spaceX){
for (let y= 20; y< height; y += spaceY){
let d= dist(mouseX, mouseY, x, y);
if( d< 100){
fill(255, 0, 0, 100);
diam = map(d, 0, 100, 50, 1);
} else {
fill(255,30);
diam = 15;
}
ellipse(x, y, diam);
}
}
}