Move game loop to function
Merge pull request #1 from ryanplasma/master

Move game loop to function