Last active
May 24, 2021 00:25
-
-
Save takawo/73d01735f3ae8eb8706237eae9c50dc7 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| 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