Due: Friday 11/15 10:00am

Submission name: work25_lightning

More Lightning!

In assgnments 7 and 8, you generated lightning bolts by creating connected lines. Today, you have many more tools at your disposal to make even better lightning bolts. Using arrays and any other relevant tools we have covered so far, write a processing program that:

  • Will draw a randomly generated lightning bolt segment-by-segment over time (use the general guidelines for the bolt segments from the previous lightning assignments.)
  • When the bolt reaches its end, the entire bolt should be visible for a short period of time (keep the framerate to 30 or 60 fps).
  • After that period, have the whole screen be white for a short, but perceptible, amount of time.
  • Draw another lightning bolt in the same manner, repeating the entire process.

Optional Additions

If you get the above working, try some of these:

  • Instead of having separate arrays for x and y values, try using the PVector class.
  • Draw multiple bolts at the same time.
  • Draw multiple bolts, but not necesarily at the same exact time (i.e. the second bolt starts when the first one is halfway down).
  • Allow for the lightning bolt to fork off into two (or more) bolts.