Source


let offset = 0;
function setup() {
  createCanvas(640, 480);
  noFill();
  // noLoop();
}

function draw() {
  background(255);
  stroke(0, 32);
  const step = 3;
  const scale = 0.06;
  const delta = 2;
  for (let j = 0; j < height; j+= 2){
    let y = j;
    let x = -30;
    while (x < width){
      const n = delta * (noise(x * scale, j * scale, offset*scale) - 0.5);
      line(x, y, x+step, y+n);
      x += step;
      y += n;
    }
    
  }
  offset+=step;
}



function keyTyped(){
  if (key === 'r'){
    redraw();
    noiseSeed(random(5000));

  }
}