xxxxxxxxxx
39
let currentX;
let currentY;
let lastX;
let lastY;
let mv;
function setup() {
createCanvas(400, 400);
background(255);
stroke(0);
currentX = width/2;
currentY = height/2;
lastX = width/2;
lastY = width/2;
mv = 5;
}
function draw() {
stroke(random(0, 255), random(0, 255), random(0, 255));
let randomX = random(-mv, mv);
let randomY = random(-mv, mv);
currentX += randomX;
currentY += randomY;
line(lastX, lastY, currentX, currentY);
lastX = currentX;
lastY = currentY;
}