> show canvas only <


/* built with Studio Sketchpad: 
 *   https://sketchpad.cc
 * 
 * observe the evolution of this sketch: 
 *   https://studio.sketchpad.cc/sp/pad/view/ro.Q31tKdQsYdB/rev.3
 * 
 * authors: 
 *   GoToLoop

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



/**
 * Stripes (v2.0)
 * by  MilleniumPanda
 * mod GoToLoop (2015-Apr-06)
 *
 * forum.processing.org/two/discussion/10201/
 * need-help-with-a-cst-project-beginner
 *
 * studio.processingtogether.com/sp/pad/export/ro.9yLN5A4NXl0YH/latest
 */

static final int W = 5, H = 50, FPS = 60;
static final color BG = 0100;

int x, y, s = W;

void setup() {
  size(500, 400, JAVA2D);
  noSmooth();
  frameRate(FPS);

  strokeWeight(W);
  strokeCap(SQUARE);
  strokeJoin(MITER);

  stroke((color) random(#000000));
  background(BG);
}

void draw() {
  line(x, y, x, y + H);
  update();
}

void update() {
  if ((x += s) > width | x < 0) {
    s *= -1;
    stroke((color) random(#000000));

    if ((y += H) >= height) {
      y = 0;
      background(BG);
    }
  }
}