xxxxxxxxxx
let particles;
let recursions;
function setup() {
createCanvas(windowWidth, windowHeight);
background(255);
colorMode(HSL);
particles = [];
}
function draw() {
background(0, 0, 100);
// Uncomment (or comment) line 11 for a different effect
recursions = round(random(3, 7));
for(let i = 0; i < recursions; i++) {
particles.push(new Particle(random(mouseX - 10, mouseX + 10), random(mouseY - 10, mouseY + 10)));
}
particles.forEach(d => d.display());
particles.forEach(d => d.move());
}
function mousePressed() {
background(255);
particles = [];
}