////080220e, build upon 080220d, slinky troupe // add another slinky troupe after delay // get some variables (dimensions of our angle) int x0 = 40; // have to declare the type in P int y0 = 80; // have to declare the type in P int dx = 50; // width of step int dy = 50; // height of riser int ex = 0; // length to erase // setup the canvas void setup(){ size(400, 300); // do not want to change this later background(0); // black is nice for a movie/} frameRate(30); // slow } // draw some lines void draw(){ background(0); if (frameCount < 50){ stroke(255, 255, 0); // yellow on black is nicer } draw3(); ex = ex + 1; // incr erase each frame // print(frameCount); // debug line if (frameCount == 50){ ex = 0; // reset eraser stroke(0, 255, 255); // change to cyan x0 = x0 + 150; // change position y0 = y0 + 50; } } void draw1(int cx, int cy){ noFill(); smooth(); strokeWeight(10.0); strokeJoin(MITER); int u = x0 + cx; // offset x int v = y0 + cy; // offset x if (ex < dx){ beginShape(); vertex(u + ex, v); // x0 + dx, y0); // first step vertex(u + dx, v); // x0 + dx, y0 + dy); // fixed riser vertex(u + dx, v + dy); // ); // second step vertex(u + dx + ex, v + dy); // end point endShape(); } } void draw3(){ draw1(0, 0); // do the shape draw1(20, -20); // do the shape draw1(40, -40); // do the shape } //// end