snowflakes = new SnowFlake[0];
wind = map(mouseX, 0, width, -1, 1);
for (int i=0; i<snowflakes.length; i++) {
snowflakes[i].cx=snowflakes[i].cx+wind;
SnowFlake mySnowFlake = new SnowFlake(mouseX, mouseY);
snowflakes = (SnowFlake[]) append(snowflakes, mySnowFlake);
SnowFlake(int centerX, int centerY) {
speed = int(random(2, 4));
howComplex = int(random(3, 6));
numSpokes = int(random(5, 8));
transparency = int(random(20, 180));
rotatedList = new int[howComplex];
radiusList = new int[howComplex];
spokeLengthList = new int[howComplex];
for(int i=0; i<howComplex; i++)
rotated = int(random(0, 55));
radius = int(random(2, 10));
spokeLength = int(random(2, 25));
rotatedList[i] = rotated;
spokeLengthList[i] = spokeLength;
stroke(255, 255, 255, transparency);
fill(255, 255, 255, transparency);
for (int i = 0; i < howComplex; i++) {
rotated = rotatedList[i];
spokeLength = spokeLengthList[i];
float theAngle = 360/numSpokes;
for (int j = 0; j < numSpokes; j++) {
float elbowX = cx + cos(radians(theAngle*j+rotated)) * spokeLength;
float elbowY = cy+ sin(radians(theAngle* j+rotated))* spokeLength;
float wristX = elbowX + cos(radians(theAngle*j+rotated)) * spokeLength * 1.5;
float wristY = elbowY + sin(radians(theAngle*j+rotated)) * spokeLength * 1.5;
line(cx, cy, elbowX, elbowY);
ellipse(elbowX, elbowY, radius, radius);
line(elbowX, elbowY, wristX, wristY);
ellipse(wristX, wristY, radius, radius);
for(int i=0; i<howComplex; i++)
rotatedList[i]=rotatedList[i]+1;