xxxxxxxxxx
34
function setup() {
createCanvas(400, 400);
}
let status = 0
let offset = 0.0
let n
let m
function draw() {
background(220);
if (status === 0){
horizontalLines();
} else {
verticalLines();
}
if (mouseIsPressed){
status = 1
} else {
status = 0
}
}
function horizontalLines(){
offset = offset + 0.02
n = noise(offset) * width;
line(n, 0, n, height)
}
function verticalLines(){
offset = offset + 0.02
m = noise(offset) * height
line(m, 0, m, width)
}