Skip to content

Instantly share code, notes, and snippets.

@takawo
Last active May 24, 2021 00:25
Show Gist options
  • Select an option

  • Save takawo/73d01735f3ae8eb8706237eae9c50dc7 to your computer and use it in GitHub Desktop.

Select an option

Save takawo/73d01735f3ae8eb8706237eae9c50dc7 to your computer and use it in GitHub Desktop.
function setup() {
createCanvas(400, 400);
angleMode(DEGREES);
}
function draw() {
background(240);
push();
translate(0, height / 2);
let px, py, x, y;
x = 0;
y = 0;
px = x;
py = y;
while (x < width) {
y = sin(x) * 50 * cos(frameCount);
let n = noise(x / 400, y / 10, frameCount / 100);
if (n > 0.5) {
line(px, py, x, y);
}
px = x;
py = y;
x += 2;
}
pop();
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment