Made the game loop run on a new thread