Copy the lightningTimed processing program in to your work repository.
Follow the following prompts. Place your answers at the top of your code using comments.
// is the inline comment symbol, used to comment a single line of code.
/* */ is the block coment symbol, anything between the two asterisks will be commented out, including newlines.
Task 0
Read the entire program (do not run it yet), make note of anything you have not seen or used before in class.
Task 1
Run the program, describe, in your own words, in at most 2 sentences, generally what it does.
Task 2
Now that you have read & run the program, answer the following specific questions about the code. Use your own words, do not look these up in the processing reference manual. You may want to alter the program slightly to test things.
What is the purpose of the draw method?
What does the frameRate method do?
What does the frameCount variable represent?
What is the puprpose of this piece of code frameCount % 30 == 0?
Task 3
Modify the code so that only 1 lightning bolt can be seen at a time. Specifically, just the new lightning bolt that has been drawn. This can be done by adding a single line of code. What line of code did you add?
Task 4
Modify the code so that 5 frames before a lightning bolt is drawn, the entire screen turns white. (i.e. black screen, white screen, lightning bolt on black screen, repeat…). This will require at least 2 lines of code. What lines of code did you add?