void Star(float xpos, float ypos, int num) { float value = 126 * num; fill(137, 22, value/2, 50); int [] x = {50, 61, 83, 69, 71, 50, 29, 31, 17, 39}; int [] y = {18, 37, 43, 60, 82, 73, 82, 60, 43, 37}; beginShape(); for (int i = 0; i < x.length; i++) { vertex (x[i], y[i]); } endShape(CLOSE); if (num>1) { num = num-1; int branches = int(random(2, 6)); for (int i = 0; i < branches; i++) { float a = random(0, TWO_PI); float newx = xpos + cos(a) * 6.0 * num * 3; float newy = ypos + sin(a) * 6.0 * num * 3; pushMatrix(); translate(xpos, ypos); scale(0.75); Star(newx, newy, num); popMatrix(); } } }