Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- int start;
- int startVerticalLine = 20; //where the first vertical line is
- int startHorizontalLine = 20;
- int gridSpacing = 20; // how much the vertical lines are spaced
- void setup() {
- start = millis(); // initialising the start
- size(600, 600);
- background(0);
- smooth();
- noStroke();
- } // end setup
- void draw() {
- //Timer
- int timer = millis()-start;
- textSize(20);
- text(timer, 10, 10);
- if (timer > 5000) {
- // grid();
- }
- } // end draw
- void grid() {
- background(255);
- while (startVerticalLine < width) {
- line(startVerticalLine, 0, startVerticalLine, height);
- startVerticalLine = startVerticalLine + gridSpacing;
- }
- //draw horizontal lines for grid
- while (startHorizontalLine < height) {
- line(0, startHorizontalLine, width, startHorizontalLine);
- startHorizontalLine = startHorizontalLine + gridSpacing;
- }
- }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement