#### Howdy, Stranger!

We are about to switch to a new forum software. Until then we have removed the registration on this forum.

# Random Snowflake animation with Array | UPDATE

edited November 2013

Hi there,

I'm glad you've opened this thread! I got one question regarding this simple code I made: (Outtake)

``````  z = z - 1;
frameRate(60);
zsnow = 0;

for (int counter = 0; counter < z; counter++) { // z = 19
xsnow[zsnow] += 120;
println( xsnow[2] );
zsnow ++;
}

}; // Setup End

void draw() {
updatePixels();

ysnow[z] += 0.8;
generiereSchnee (xsnow[0], ysnow[z]);
generiereSchnee (xsnow[1], ysnow[z]);
generiereSchnee (xsnow[2], ysnow[z]);
generiereSchnee (xsnow[3], ysnow[z]);
generiereSchnee (xsnow[4], ysnow[z]);
generiereSchnee (xsnow[5], ysnow[z]);
generiereSchnee (xsnow[6], ysnow[z]);
generiereSchnee (xsnow[7], ysnow[z]);
generiereSchnee (xsnow[8], ysnow[z]);
generiereSchnee (xsnow[9], ysnow[z]);

if (ysnow[z]>=height) {
ysnow[z] = 0;
}
}
``````

Why is xsnow[] value for all [x] values = 120? It should actually start from 120 and then add 120 everytime the for loop goes thorugh, so that the snow in my draw will start at different x-coordinates.

Best Regards, iSpectra

Tagged:

• An online example of bubbles rising up. Very similar to snow flakes falling down? /:)

• To complicated. Sorry.

`xsnow[zsnow] += 120;`
`xsnow[counter] = (counter + 1) * 120;`