Here is the code and Id apply wind force instead of friction,
int NrDisks = 120;
float Gravity = 0.03;
float Fri = -0.9;
Disk[] disks = new Disk[NrDisks];
void setup() {
size(700, 700);
for (int i = 0; i < NrDisks; i++) {
disks [i] = new Disk(-random(height ), -random(width)/2, random(20, 20), i, disks );
}
noStroke();
fill(255, 204);
}
void draw() {
background(0);
for (Disk disk : disks ) {
disk.move();
disk.display();
}
}
class Disk {
float r = random(255);
float g = random(255);
float b = random(255);
float posx, posy;
float diameter;
float velx = -2;
float vely = 2;
int id;
Disk[] others;
Disk(float xin, float yin, float d, int idin, Disk[] oin) {
posx = xin;
posy = yin;
diameter = d;
id = idin;
others = oin;
}
void move() {
vely += Gravity;
posx -= velx;
posy += vely;
if (diameter/2 > width) {
posx = width - diameter/2;
velx *= Fri;
} else if (posy - diameter > height) {
posy = height - diameter;
vely *= Fri;
}
}
void display() {
fill(r, g, b);
ellipse(posx, posy, diameter, diameter);
}
}