xxxxxxxxxx
25
let dots = [];
function setup() {
createCanvas(600, 600);
}
function draw() {
background(0);
if (mouseIsPressed) {
let dot = {
x: mouseX,
y: mouseY,
angle: 0,
};
dots.push(dot);
}
for (let i=0; i < dots.length; i++) {
dots[i].angle = dots[i].angle + 0.1;
let size = map(sin(dots[i].angle), -1, 1, 20, 60);
ellipse(dots[i].x, dots[i].y, size);
}
}