> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.pazx7-dzM5k/rev.863
 * 
 * authors: 
 *   Matthew

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



float m = millis();
float start = millis();

void setup() {  // this is run once.   
    
    // set the background color
    background(0);
    
    // canvas size (Integers only, please.)
    size(300, 300); 
      
    // smooth edges
    smooth();
    
    // limit the number of frames per second
    frameRate(36);
    
    // set the width of the line. 
    strokeWeight(1);
} 

void draw() {  // this is run repeatedly.  
    for(int i = 0; i < 4; i++) {
        int j = i + 1;
        drawLine(
            start + 40000 - (j * 10000), start + 40000 - (i * 10000),
            color(random(255-i*50, 255-j*50), random(j*50)),
            width * j * 0.1, height * j * 0.1,
            20-j*4);
    }
}

void drawLine(float t_begin, float t_end, color lineColor, int xBound, int yBound, int play) {
    m = millis();
    if (m > start + t_begin && m < start + t_end) {
        stroke(lineColor);
        int p = random(xBound, width - xBound);
        int q = random(yBound, height - yBound);
        line(p + random(-play,play),q,p + random(-play,play),height - q);
        line(p,q + random(-play,play),width - p,q + random(-play,play));
    }
}