float n = 100; // number of frames per animation cycle void setup(){ size(400, 400); frameRate(50); // number of frames per second } void draw(){ background(255); // don't forget to clear at each frame float r1 = frameCount % n / n; rect(0, 0, width * r1, height * r1); float r2 = r1 - 0.5; ellipse(width * 0.5, height * 0.5, width * r2, height * r2); for(int i = 0; i < frameCount % n; i++){ float y = height / n * i; line(0, y, y, y); } } void mouseMoved(){ } void mouseDragged(){ } void mousePressed(){ } void mouseClicked(){ }