Lightning
The main problems that I encountered with the lightning program was making the lightning flash at slightly randomed points in time. I acheived this by using float values and millis() to determine the lightning flash interval. Other float values were used to determine when the last flash occured and when the next flash should be. The lightning flashes would fade by calling noStroke() and using fill() parameters to increase the opacity and brightness of a called screen-sized rect(). Increasing the opacity and brightness gradually blackened out the lightning colors, creating the needed fade out effect.