Permalink
Newer
Older
100644 33 lines (26 sloc) 619 Bytes
1
class Waves extends Routine {
2
3
int NUMBER_OF_WAVES = 4;
4
Wave[] waves;
5
6
void setup(PApplet parent) {
7
super.setup(parent);
8
if (NUMBER_OF_WAVES > 0) {
9
waves = new Wave[NUMBER_OF_WAVES];
10
for (int i=0; i<NUMBER_OF_WAVES; i++) {
11
waves[i] = new Wave();
12
}
13
}
14
}
15
16
void draw() {
17
background(0);
18
for (int i=0; i<NUMBER_OF_WAVES; i++) {
19
waves[i].draw();
20
}
21
22
long frame = frameCount - modeFrameStart;
23
if (frame > frameRate*TYPICAL_MODE_TIME) {
24
for (int i=0; i<NUMBER_OF_WAVES; i++) {
25
waves[i].init();
26
}
27
28
newMode();
29
}
30
}
31
}
32