Advertisement
xeromino

skyline

Nov 3rd, 2013
235
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
Java 0.76 KB | None | 0 0
  1. void setup() {
  2.   size(800, 1200);
  3.   background(122);
  4.   stroke(0);
  5.   fill(255);
  6.   strokeWeight(4);
  7.   strokeJoin(ROUND);
  8.  
  9.   for (int i=0; i<50; i++) {
  10.     fill(255);
  11.     float x = random(width);
  12.     float y = height;
  13.     float x2 = x;
  14.     float y2 = random(height/7, height);
  15.     float x3 = x2 + random(20, 100);
  16.     float y3 = y2 - random(20, 100);
  17.     float x4 = x3;
  18.     float y4 = y;
  19.     quad(x, y, x2, y2, x3, y3, x4, y4);
  20.     fill(200);
  21.     x = x4;
  22.     y = y4;
  23.     x2 = x3;
  24.     y2 = y3;
  25.     x3 = x2 + random(20, 60);
  26.     y3 = y2 + random(20, 60);
  27.     x4 = x3;
  28.     y4 = height;    
  29.     quad(x, y, x2, y2, x3, y3, x4, y4);
  30.   }
  31. }
  32.  
  33. void draw() {
  34. }
  35.  
  36. void mouseClicked() {
  37.   setup();
  38. }
  39.  
  40. void keyPressed() {
  41.   save(random(12345)+".png");
  42. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement