adding game over as state, and catching 'not a function' exceptions in game loop