Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- // This TAB is for particles
- // Filling the arrays
- void fillArrays(){
- // We are going to go one particle by one
- for(int i = 0; i<totalP; i++){
- x[i] = 12;
- y[i] = random(height);
- noiseX[i] = random(12, 40000);
- varX[i] = 0;
- }
- }
- void showParticles(){
- // We are going to go one by one with a for loop
- for(int i=0; i<totalP; i++){
- // 1. Calculating positions
- varX[i] += noiseX[i];
- x[i] = noise(varX[i])*width;
- //2. Showing the particles
- ellipse(x[i], y[i], 40,40);
- } // for loop ends
- } // our function ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement