sys.exit() to exit the game ➎. The call to pygame.display.flip() at ➏ tells Pygame to make the most recently drawn screen visible. In this case it draws an empty screen each time through the while loop to erase the old screen so that only the new screen is visible. When we move the game elements around, pygame.display.flip() will continually update the display to show the new positions of elements and hide the old ones, creating the illusion of smooth movement.

