mdinep/trafficlight — pull request #1 by brewerja (2014-03-07 13:09:18+00:00)
Title: Some simple improvements and suggestions.

Easy PEP8 Fixes:
- Mixes tabs and spaces
- Simple spacing around commas, etc. PEP8 stuff
Use collidrect rather than the nested if's on mouse position
Catch the QUIT event to allow user to close window
No need for try except blocks in this case, bad image file would be reason to stop

Potential Improvements:
Would be nice not to block the UI (be able to quit during lightcycle)
I used time.sleep to clean things up a bit, but if you wanted not to block,
you'd probably need a generator

Probably be nice to encapsulate the light's state, consolidate where the images
are loaded so that red's not alone in the main function with the rest in the lightcycle