// Dartmouth CS 2, Winter 2009, Chris Bailey-Kellogg // Notes 16 | Sketch 5 // Based on Processing example Topics | Drawing | Animator // and Reas & Fry Synthesis | Chronodraw, by Andreas Gysin (www.ertdfgcvb.ch) // The array of (partial) screen grabs PImage[] frames = new PImage[100]; // Which frame we're currently drawing (in the leftmost strip) int currentFrame = 0; // Layout of the strips -- how many, and how wide (calculated in setup) int numStrips = 23, stripWidth; // millis() at the last grab int lastTime = 0; void setup() { size(800,200); smooth(); background(0); stripWidth = width/numStrips; // equally sized // Create blank frames for (int i=0; i lastTime+100) { nextFrame(); lastTime = currentTime; } // Draw in the leftmost strip if (mousePressed && mouseX < stripWidth) { noFill(); stroke(255); line(mouseX,mouseY,pmouseX,pmouseY); } // Bars dividing the strips stroke(64); for (int i=1; i= frames.length) { currentFrame = 0; } // Draw all the strips -- the current frame at the far left, // the frame _before_ that to its immediate right, // then the frame _before_ that, etc. for (int strip=0; strip