Back to photostream

Experimenting with random()

float xpos;

float ypos;

 

void setup(){

size(300,200);

smooth();

background(255);

xpos=width/2;

ypos=height/2;

}

 

 

void draw(){

 

 

xpos += random(-3,3);

ypos += random(-3,3);

 

ellipse(xpos,ypos,25,25);

 

if (xpos > width || xpos height || ypos < 0){

saveFrame();

noLoop();

}

 

}

195 views
1 fave
0 comments
Uploaded on December 23, 2012