Make a loop that draws lines in processing

Posted by theolc on Stack Overflow See other posts from Stack Overflow or by theolc
Published on 2012-10-03T03:22:18Z Indexed on 2012/10/03 3:37 UTC
Read the original article Hit count: 142

Filed under:
|

I have this piece of code, and i am wondering how to make a loop that will draw these lines... Every 50 pixels on the x-axis... I am curious as to how this can be done and would like to use a loop rather than manually drawing each line! The following is the code for the lines... Please any help would be much appreciated!

  //set sidewalk
fill(255,255,255);
rect(0,490,500,10);
line(50,490,50,500);
line(100,490,100,500);
line(150,490,150,500);
line(200,490,200,500);
line(250,490,250,500);
line(300,490,300,500);
line(350,490,350,500);
line(400,490,400,500);
line(450,490,450,500);

© Stack Overflow or respective owner

Related posts about java

Related posts about processing