Sunday, November 06, 2011

Fresh Mess

// just type here
// and click "save" when your done

int[] xs = new float[10];
int[] ys = new float[10];
int[] age = new float[10];

float x,y;
color backgroundColour;
void setup() { 
  size(500,500); 
  x = 100;
  y = 100;
  backgroundColour = color(40,255,104);
  frameRate(10);

  
void draw() {
  
  background(backgroundColour); 
  fill(random(0,255),40,150, random(0, 255)); 
  rect(x,y, 100,100); 
  x += random(0, 25);
  y += 30;
  x = x % width;
  y = y % height;
  
  
  xs[frameCount%10] = x;
  ys[frameCount%10] = y;
  age[frameCount%10] = 1;
  for(int i=0; i < 10; i++) {
    rect(xs[i],ys[i],10*age[i],10*age[i]);
    xs[i] += random(1,5);
    ys[i] += random(1,5);
    age[i] += 1;
  }
  
}

info info

submitted by: spam04
views: 



treeThis sketch has a parent
Tags:

comments comment

loading loading...

 

Add a comment: