xxxxxxxxxx
int howMany = 5000;
float[] x = new float[howMany];
float[] y = new float[howMany];
float[] speed = new float[howMany];
void setup() {
size(600,600);
background(0);
noStroke();
smooth();
int i = 0;
while (i<howMany) {
x[i] = random(0, width);
y[i] =random(0, height);
speed[i] = random(5,10);
i +=1;
}
}
void draw() {
//background(0);
fill(255,150,0);
rect(0,0,width, height);
int i = 0;
while (i < howMany) {
fill(7*speed[i]);
rect(x[i], y[i],speed[i],speed[i]);
y[i] += speed[i]/2;
if (y[i] > height) {
y[i] = 0;
}
i +=1;
}
}