daily pastebin goal
84%
SHARE
TWEET

Untitled

a guest Mar 22nd, 2019 49 Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1.  
  2.  
  3. int start;
  4. int startVerticalLine = 20; //where the first vertical line is
  5. int startHorizontalLine = 20;
  6. int gridSpacing = 20; // how much the vertical lines are spaced
  7.  
  8. void setup() {
  9.   start = millis(); // initialising the start
  10.  
  11.   size(600, 600);
  12.   background(0);
  13.   smooth();
  14.   noStroke();
  15.  
  16. } // end setup
  17.  
  18.  
  19.  
  20. void draw() {
  21.   //Timer
  22.   int timer = millis()-start;
  23.   textSize(20);
  24.   text(timer, 10, 10);
  25.  
  26.  
  27.   if (timer > 5000) {
  28.      // grid();
  29.   }
  30. } // end draw
  31.  
  32.  
  33.  
  34.  
  35.  
  36.  
  37.  
  38. void grid() {
  39.   background(255);
  40.   while (startVerticalLine < width) {
  41.     line(startVerticalLine, 0, startVerticalLine, height);
  42.     startVerticalLine = startVerticalLine + gridSpacing;
  43.   }
  44.  
  45.   //draw horizontal lines for grid
  46.   while (startHorizontalLine < height) {
  47.     line(0, startHorizontalLine, width, startHorizontalLine);
  48.     startHorizontalLine = startHorizontalLine + gridSpacing;
  49.   }
  50. }
RAW Paste Data
We use cookies for various purposes including analytics. By continuing to use Pastebin, you agree to our use of cookies as described in the Cookies Policy. OK, I Understand
 
Top