xxxxxxxxxx
38
let x1;
let y1;
let x2;
let y2;
function setup() {
createCanvas(windowWidth, windowHeight);
colorMode(HSB, 360, 100, 100, 100)
x1 = 0
y1 = 0;
background(200);
}
function draw() {
background(0, 100, 10, 10);
//y1 = random(height);
strokeWeight(3);
stroke(175, 50, 100);
for (let i = 0; i < 20; i++){
x2 = x1 + random(100);
y2 = y1 + random(100);
line(x1, y1, x2, y2);
x1 = x2;
y1 = y2;
}
if (x2 >= width){
x1 = 0;
}
if (y2 >= height){
y1 = 0;
}
}
function touchStarted(){
background(map(mouseX, 0, width, 50, 300), 50, 100);
}