Digital Bauhaus Vorkurs/Projekte/Kleckse/Selbstständige Kleckse

From Medien Wiki
< Digital Bauhaus Vorkurs‎ | Projekte‎ | Kleckse
Revision as of 08:57, 11 April 2011 by Nicola (talk | contribs) (Created page with "int x = width/2; int y = height/2; int s = 10; int c = 255; int t = 10; int z = 255; int klexkomplex = 5; int dichteMin = -10; int dichteMax = 10; void setup () { size(700, ...")
(diff) ← Older revision | Latest revision (diff) | Newer revision → (diff)

int x = width/2; int y = height/2; int s = 10; int c = 255; int t = 10; int z = 255; int klexkomplex = 5; int dichteMin = -10; int dichteMax = 10;


void setup () {

 size(700, 700);
 smooth();
 noStroke();
 frameRate(10);
 reset();
 background(256, 256, 256);
 fill( 120, 130, 200, 210);

}


void reset() {

 background (256, 256, 256);
 x = (int)random(width);
 y = (int)random(height);
 s = (int)random(256);
 c = (int)random(238);
 

}


void draw() {


 ellipse(x,y,s,s);
 ellipse(x+3,y+3,s+3,s+3);
 
 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(200, 255);
   s = s + (int)random(dichteMin,dichteMax);
   t = (int)random(255);
   z = (int)random(dichteMin,dichteMax);
   fill(193, 94, 50, 210);
   
 }
 
 ellipse(x,y,s,s);
 ellipse(x+3,y+3,s+3,s+3);

 
 ellipse(x-300, y+3, z+3, z+3);
 ellipse(x+200, y-50, s+40, s+40); 

  
 }
 



void keyPressed() {

 if ((key== 'r')) {
   reset(); 
 }
 if (key== 'e') {
   exit();
 }

}