The main game loop