Hey
1. I moved the variables inside draw, so that they would have the correct values each time draw is run. (20 times per second)
2. That code just sets up some variables, where you can change the numbers to get different results.
If you read the comments on the end of each line, it should tell you what it does. Try changning timeBetweenAddedLines to 150
And set distDiv to 80. Play with the numbers
3. strokes = new float[NLINHAS]; this is an initialization of an array. an array is a list of a certain variable type, instead of just one variable.
4. That section checks to see if cLine is less than NLINHAS, and that the timeBetweenAddedLines has passed since the last time the code added a line.
It makes sure the time works in other words..
Also, it sets a random stroke for that current line
then i add 1 to cLine, so that it increments towards NLINHAS
and then I update the time, so I can check when to add the next line.
5. NLINHAS is the number of lines you want. cLine is the current number of lines to be drawn.
6. It only serves the purpose for you to have a choice..
you can keep either one of them
the one inside if(randomStrokes) makes the strokeWeight random for each line.
the other one makes each line use strokeWeight determined by the length of the line
7. And the background can be added wherever you want, but if you add it to draw, it clears the screen every frame. if you add it to setup, it only clears the screen once
hope this answers some of your questions
best regards,
seltar