rainDrop simulation
in
Programming Questions
•
3 months ago
Im tying to make a raindrops simulation but so far I came up with this code:
- void setup(){
- size(300,300);
- background(255,255,255);
- }
- void draw(){
- //Coordenadas
- float x = random(0,300);
- float y = random(0,300);
- //Colores
- float r = random(0,255);
- float g = random(0,255);
- float b = random(0,255);
- //Radio de circulo
- float d = random(0,100);
- stroke(r,g,b);
- fill(r+100,g+50,b+40);
- ellipse(x,y,d,d);
- }
- float x = 150;
- float y = 150;
- int d = 100;
- //Colores
- float r = random(0,255);
- float g = random(0,255);
- float b = random(0,255);
- void setup(){
- size(300,300);
- background(255,255,255);
- }
- void draw(){
- d = d + 1;
- stroke(r,g,b);
- fill(r+30,g+40,b+15);
- ellipse(x,y,d,d);
- }
And when d < 200 it
disappears.
HELP!!
1