Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Newer
Older
100644 28 lines (20 sloc) 0.359 kb
a6b64d8 @potatono Refactored everything into separate classes.
potatono authored
1 class Waterfall {
2 float x;
3 float y;
4 float len;
5 float v;
6
7 public Waterfall() {
8 this.reset();
9 }
10
11 public void reset() {
12 x = int(random(0, WIDTH));
13 y = -1;
14 len = random(1, 5);
15 v = random(0.1, 1);
16 }
17
18 public void draw() {
19 y = y + v;
20
21 rect(x, y, 0.1, len);
22 if (y > HEIGHT) this.reset();
23
24 }
25 }
26
27
Something went wrong with that request. Please try again.