class Ring { float x, y; float diameter; boolean on = false; // whether or not it's being shown // Turn ring on, starting to expand from (x0,y0) void start(float x0, float y0) { x = x0; y = y0; on = true; diameter = 1; } void grow() { if (on) { diameter += 0.5; if (diameter > 400) { // too big -- stop it on = false; } } } // CBK variation void display() { if (on) { noFill(); int d = round(diameter); int a = 200; // More opaque at larger diameter while (d > 0 && a > 0) { stroke(150, a); ellipse(x, y, d, d); d -= 10; a -= 20; } } } }