xxxxxxxxxx
38
let x;
let y;
let offset = 0;
let perlinY;
let previousX = 0;
let previousY = 0;
function setup() {
createCanvas(400, 400);
strokeWeight(2);
x = 0;
}
function draw() {
perlinY = noise(offset); // between 0-1
y = map(perlinY, 0, 1, 50, height-50); // between 0-width
// y = random(0, height);
// point(x, y);
line (previousX, previousY, x, y);
offset = offset + 0.05;
x = x + 1;
if (x > width) {
x = 0;
background(255);
}
previousX = x;
previousY = y;
}