// Viral Expansion 1x // by John Clavin float R; float G; float B; int pF = 6; // powerFactor int xPos; int yPos; color levelColor; void setup() { size(700, 500); background(240); stroke(0); smooth(); frameRate(.25); } void draw() { setColor(); background(240); explode(width/2, height/2, 15); } void explode(int x, int y, int level) { R += .0075; G -= .0075; B += .0026; levelColor = color(R, G, B); xPos = x + int(random(-pF, pF)); yPos = y + int(random(-pF, pF)); fill(levelColor); ellipse(xPos, yPos, 6, 6); if(level > 1) { level--; explode(xPos, yPos, level); explode(xPos, yPos, level); } } void setColor() { R = 0; G = 255; B = 0; }