We are about to switch to a new forum software. Until then we have removed the registration on this forum.
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 ++;
}
loadPixels();
}; // 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
Answers
An online example of bubbles rising up. Very similar to snow flakes falling down? /:)
http://studio.processingtogether.com/sp/pad/export/ro.9ZKbYJpM0CfPR/latest
To complicated. Sorry.
xsnow[zsnow] += 120;
all the xsnow[] start at 0. this adds 120 to each of them in turn. i think you just want
xsnow[counter] = (counter + 1) * 120;
Thank you so much! I'm always stunned how fast this community responds. =D>