Moved the game loops to the game class