xxxxxxxxxx
let strings = [];
function setup() {
createCanvas(windowWidth, windowHeight);
background(100);
noFill();
background(0);
stroke(255);
}
function mousePressed() {
let newString = {
x: mouseX,
y: mouseY,
}
strings.push(newString);
}
function draw() {
for (let i = 0; i < strings.length; i++) {
let String = strings[i];
newx = String.x + random(-10, 10);
newy = String.y + random(-10, 10);
line(String.x, String.y, newx, newy)
String.x = newx
String.y = newy
}
}