|
|
Line 17: |
Line 17: |
|
| |
|
| === [[/code#ellipseSpritzer| * CODE]] === | | === [[/code#ellipseSpritzer| * CODE]] === |
|
| |
|
| |
| int x = width/2;
| |
| int y = height/2;
| |
| int s = 10;
| |
| int c = 255;
| |
| int a;
| |
| int klexkomplex = 5;
| |
| int dichteMin = -10;
| |
| int dichteMax = 10;
| |
|
| |
|
| |
|
| |
| void setup () {
| |
|
| |
| size(700,700);
| |
| smooth();
| |
| background(0);
| |
| noStroke();
| |
| reset();
| |
|
| |
|
| |
|
| |
| ellipse(x,y,s,s);
| |
|
| |
| }
| |
|
| |
| void reset() {
| |
|
| |
| background (255);
| |
| x = (int)random(width);
| |
| y = (int)random(height);
| |
| s = (int)random(255);
| |
| c = (int)random(238);
| |
|
| |
| }
| |
|
| |
| void draw () {
| |
|
| |
| if(klexkomplex > (width/15) ) {
| |
| return;
| |
|
| |
| }
| |
|
| |
| ellipse(x,y,s,s);
| |
|
| |
| int i;
| |
| for(i=0; i<klexkomplex; i=i+1) {
| |
| x = x + (int)random(dichteMin,dichteMax);
| |
| y = y + (int)random(dichteMin,dichteMax);
| |
| c = (int)random(255);
| |
| a= (int)random(0,100);
| |
| s = (int)random(dichteMin,dichteMax);
| |
| fill(c, 191, 255);
| |
|
| |
|
| |
| }
| |
| ellipse(x,y,s,s);
| |
| }
| |
|
| |
|
| |
|
| |
|
| |
| void keyPressed() {
| |
| if ((key== 'r')) {
| |
|
| |
| reset();
| |
| }
| |
|
| |
| }
| |
|
| |
| void c() {
| |
| if (key== 'h') {
| |
|
| |
| }
| |
| }
| |