Example code from 'Rapid game dev in Python'