-
Notifications
You must be signed in to change notification settings - Fork 0
/
flower.pde
25 lines (19 loc) · 900 Bytes
/
flower.pde
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
class flower extends geoform {
private ArrayList<cirkel> cirkels;
public flower(PApplet app, PVector center, int size, color cc, color oc) {
super(app, center, size, cc, oc);
cirkels = new ArrayList<cirkel>();
int radius = round(size / 2);
cirkels.add( new cirkel(app, center, radius, cc, oc) );
int newradius = round(radius / 4);
cirkels.add( new cirkel(app, new PVector(center.x, center.y-radius-newradius), newradius, oc, cc) );
cirkels.add( new cirkel(app, new PVector(center.x+radius+newradius, center.y), newradius, oc, cc) );
cirkels.add( new cirkel(app, new PVector(center.x, center.y+radius+newradius), newradius, oc, cc) );
cirkels.add( new cirkel(app, new PVector(center.x-radius-newradius, center.y), newradius, oc, cc) );
}
public void draw() {
for( cirkel c : cirkels ) {
c.draw();
}
}
}