> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.Q4kVVKzcZnY/rev.223
 * 
 * authors: 
 *   joão Miguel

 * license (unless otherwise specified): 
 *   creative commons attribution-share alike 3.0 license.
 *   https://creativecommons.org/licenses/by-sa/3.0/ 
 */ 



// This sketch builds on a prior work, "Liliana Dantas - 02 - flies", created by Liliana Dantas
// http://dflab.sketchpad.cc/sp/pad/view/ro.9qHniGWx3fVBoi/rev.16



float px[];
float py[];

int num_particles = 5;

void setup() {
  size(500, 500);
  background(0);


  
  fill(255);
  px = new float[num_particles];
  py = new float[num_particles];
  
  for (int i = 0; i < num_particles; i++) {
    px[i] = random(width);
    py[i] = random(height);
  }
}

void draw() {
  background(0);
  
  fill(120,90,90);
  noStroke();
ellipse(200,475,250,50);
ellipse(185,450,200,50);
ellipse(180,425,100,70);
ellipse(180,425,100,70);

fill(245,234,173)
noStroke();
triangle(250,490,290,400,490,490);
  
  fill(255);
    for (int i = 0; i < num_particles; i = i+1) {
        px[i] = constrain (px[i] + random (-20, 20), 125, 375);
        py[i] = constrain (py[i] + random (-20, 20), 125, 375);
 
        ellipse (px[i], py[i], 5, 10);
  }
}