Friday, April 27, 2012
Shooting Stars
int num = 60;
float ab[] = new float[num];
float ac[] = new float[num];
void setup(){
size(800,400);
background(0,0,0);
}
void draw(){
stroke(0,0,0);
strokeWeight(10);
fill(random(1,500), random(1,500), random(1,500));
for(int i=2; i<num; i++) {
ab[i-2] = ab[i];
ac[i-2] = ac[i];
}
ab[num-3] = mouseX;
ac[num-3] = mouseY;
for(int i=0; i<num; i++) {
ellipse(ab[i], ac[i], i/2, i/2);
}
}
void reset(){
background(0);
}
void mousePressed(){
reset();
}
float ab[] = new float[num];
float ac[] = new float[num];
void setup(){
size(800,400);
background(0,0,0);
}
void draw(){
stroke(0,0,0);
strokeWeight(10);
fill(random(1,500), random(1,500), random(1,500));
for(int i=2; i<num; i++) {
ab[i-2] = ab[i];
ac[i-2] = ac[i];
}
ab[num-3] = mouseX;
ac[num-3] = mouseY;
for(int i=0; i<num; i++) {
ellipse(ab[i], ac[i], i/2, i/2);
}
}
void reset(){
background(0);
}
void mousePressed(){
reset();
}
info
submitted by:
Demitchimoviews: 151
Create colour in a world of darkness! [if you want to reset the page click the mouse]
comments

Add a comment: