Advertisement
xeromino

LasVegas

Oct 27th, 2013
271
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.85 KB | None | 0 0
  1. ArrayList thingies = new ArrayList();
  2. float grid, sz, theta;
  3. int flip = -1;
  4. int stepx = 20;
  5. int stepy = stepx/5*3;
  6. int column, row;
  7. color bg = #490A3D; // #431126;
  8. color col1 = #BD1550; // #ECE3B7;
  9. color col2 = #F8CA00; // #DDB38F;
  10.  
  11. void setup() {
  12.   size(500, 300);
  13.   background(bg);
  14.   column = width/stepx;
  15.   row = height/stepy;
  16.   sz = column -2;
  17.   rectMode(CENTER);
  18.  
  19.   for (int y=0; y<height; y+=row) {
  20.     flip *= -1;
  21.     for (int x=0; x<width;x+=column) {
  22.       Thingie thingie = new Thingie(x, y, flip, theta);
  23.       thingies.add(thingie);
  24.       flip *= -1;
  25.       theta += TWO_PI/stepx;
  26.     }
  27.   }
  28. }
  29.  
  30. void draw() {
  31.   background(bg);
  32.  
  33.   for (int i=0; i<thingies.size();i++) {
  34.     Thingie thing = (Thingie) thingies.get(i);
  35.     thing.display();
  36.   }
  37.  
  38.   //if (frameCount % 3 == 0 && frameCount < 91) saveFrame("image-####.gif");
  39. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement