Fixed the class structure to have a game manager class that handles the game loop.