> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://dflab.sketchpad.cc/sp/pad/view/ro.B7pxWp9x4p3/rev.131
 * 
 * authors: 
 *   Santa Tamia

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



float px[];
float py[];
 
int num_particles = 50;
 
void setup() {  
    size(300, 300); 
 
background(200,255,50);
    
    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(200,255,50);
    
    for (int i = 0; i < num_particles; i = i+1) {
        px[i] = constrain (px[i] + random (-15, 20), 0, width);
        py[i] = constrain (py[i] + random (-15, 20), 0, height);
        
        strokeWeight(-1);
        fill(256,-25,-70)
        rect (px[i], py[i], 9, 5);
    }
}