Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // vertical start
- float y = 80;
- // vertical displacement between lines
- float dy = 1;
- void setup () {
- size (800, 600);
- background(100);
- }
- void draw () {
- // stop drawing before we get out of the screen
- if (y < 500) {
- float lastx = -20;
- float lasty = 0;
- float currx = 0;
- float curry = 0;
- while (currx < width) {
- currx = lastx + 10;
- curry = y + 80 * noise(currx/70, y/70);
- line (lastx, lasty, currx, curry);
- lastx = currx;
- lasty = curry;
- }
- // move down
- y = y + dy;
- // increase line separation
- dy = dy * 1.1;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement