xxxxxxxxxx
let x;
let y;
let lineAnzahl = 777;
let col;
let k = 0;
function setup() {
createCanvas(900, 600);
x = width / 2;
y = height / 2;
col = random(50,255);
background(0);
}
function draw() {
if (k < lineAnzahl) {
let nextX = x + random(-100, 100);
let nextY = y + random(-50, 50);
nextX = constrain(nextX, 0, width);
nextY = constrain(nextY, 0, height);
col += random(-10, 10);
col = constrain(col, 50, 255);
stroke(col);
strokeWeight(random(2));
line(x, y, nextX, nextY);
x = nextX;
y = nextY;
k++;
} else {
noLoop();
}
}