Advertisement
lexgilmore

Untitled

Nov 15th, 2018
98
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. // This TAB is for particles
  2. // Filling the arrays
  3.  
  4. void fillArrays(){
  5.   // We are going to go one particle by one
  6.   for(int i = 0; i<totalP; i++){
  7.     x[i] = 12;
  8.     y[i] = random(height);
  9.     noiseX[i] = random(12, 40000);
  10.     varX[i] = 0;
  11.   }
  12. }
  13. void showParticles(){
  14.   // We are going to go one by one with a for loop
  15.   for(int i=0; i<totalP; i++){
  16.     // 1. Calculating positions
  17.     varX[i] += noiseX[i];
  18.     x[i] = noise(varX[i])*width;
  19.     //2. Showing the particles
  20.     ellipse(x[i], y[i], 40,40);
  21.    
  22.   } // for loop ends
  23. } // our function ends here
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement