public class Rain { PVector position, pposition, speed; float col; public Rain() { position = new PVector(random(0, width), 0); pposition = position; speed = new PVector(0, 0); col = random(30, 100); } void draw() { stroke(100, col); strokeWeight(2); line(position.x, position.y, pposition.x, pposition.y); //ellipse(position.x,position.y,5,5); } void calculate() { pposition = new PVector(position.x, position.y); gravity(); } void gravity() { speed.y += .2 + (0.1 * int((height - ((cloud1.y + cloud2.y + cloud3.y + cloud4.y + cloud5.y)/5)) / 50)); speed.x += .01; position.add(speed); } }