> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.xxknKlMErXh/rev.288
 * 
 * authors: 
 *   André Reis

 * 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, "Sara Reis - 03 - The Girl with Kaleidoskope Eyes", created by Sara Reis
// http://dflab.sketchpad.cc/sp/pad/view/ro.9tPdMtFAQQMFpT/rev.760



float px[];
float py[];
 
int num_particles = 10;

 
void setup() {  
    size(500, 500); 
 
    background(0,0,0);
    
    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);
    if (mousePressed) {
    stroke (random (255),random (255), random (255));
  } else {
    stroke(255);
  }


    

    for (int i = 0; i < num_particles; i = i+1) {
        px[i] = constrain (px[i] + random (-100, 200), 200, width);
        py[i] = constrain (py[i] + random (-50, 50), 0, height);
        
       
        strokeWeight(5);
       
        fill(0, 255, 10)
        ellipse (px[i], py[i], 1, 1000);
        
    }
}