has used up all their shipsgame_ functions py def ship_hit(ai_settingsstatsscreenshipaliensbullets)"""respond to ship being hit by alien ""if stats ships_left decrement ships_left stats ships_left - --snip-pause sleep( elsestats game_active false most of ship_hit(is unchanged we've moved all of the existing code into an if blockwhich tests to make sure the player has at least one ship remaining if sowe create new fleetpauseand move on if the player has no ships leftwe set game_active to false identifying when parts of the game should run in alien_invasion py we need to identify the parts of the game that should always run and the parts that should run only when the game is activealien_ invasion py start the main loop for the game while truegf check_events(ai_settingsscreenshipbulletsif stats game_activeship update(gf update_bullets(ai_settingsscreenshipaliensbulletsgf update_aliens(ai_settingsstatsscreenshipaliensbulletsgf update_screen(ai_settingsscreenshipaliensbulletsin the main loopwe always need to call check_events()even if the game is inactive for examplewe still need to know if the user presses to quit the game or clicks the button to close the window we also continue updating the screen so we can make changes to the screen while waiting to see whether the player chooses to start new game the rest of the function calls only need to happen when the game is activebecause when the game is inactivewe don' need to update the positions of game elements now when you play alien invasionthe game should freeze when you've used up all of your ships aliens