class Particle { float ox, oy; // original position float x, y; // current position float vx, vy; // velocity float t; // transparency float dt = 3; // transparency step float g = 0.1; // gravity float r = 3; // radius Particle(float x0, float y0) { ox = x0; oy = y0; initialize(); } // Put at original position, fully opaque, with random velocity void initialize() { x = ox; y = oy; // More vertical than horizontal vx = random(-3,3); vy = random(-5,-1); t = 255; } void draw() { fill(255,t); ellipse(x,y,2*r,2*r); } void update() { t -= dt; // decay the transparency // Usual gravity stuff vy += g; x += vx; y += vy; // When exit screen or totally transparent, re-initialize if (t < 0 || x>width+r || xheight+r || y