xxxxxxxxxx
22
const LENGTH = 400;
let mouseLocs = [];
function setup() {
createCanvas(windowWidth, windowHeight);
for (let i = 0; i < LENGTH; i++) {
mouseLocs.push(createVector(width / 2, height / 2));
}
}
function draw() {
background(0);
mouseLocs.push(createVector(mouseX, mouseY));
mouseLocs.shift();
noFill();
stroke(255);
strokeWeight(3);
for (let i = 0; i < LENGTH; i += 10) {
let radius = map(i, 0, LENGTH - 1, width, 10);
circle(mouseLocs[i].x, mouseLocs[i].y, radius);
}
}