game should pauseand new fleet should appear with the ship centered at the bottom of the screen again aliens that reach the bottom of the screen if an alien reaches the bottom of the screenwe'll respond the same way we do when an alien hits the ship add new function to perform this checkand call it from update_aliens()game_ functions py def check_aliens_bottom(ai_settingsstatsscreenshipaliensbullets)"""check if any aliens have reached the bottom of the screen ""screen_rect screen get_rect(for alien in aliens sprites() if alien rect bottom >screen_rect bottomtreat this the same as if the ship got hit ship_hit(ai_settingsstatsscreenshipaliensbulletsbreak def update_aliens(ai_settingsstatsscreenshipaliensbullets)--snip-look for aliens hitting the bottom of the screen check_aliens_bottom(ai_settingsstatsscreenshipaliensbulletsthe function check_aliens_bottom(checks to see whether any aliens have reached the bottom of the screen an alien reaches the bottom when its rect bottom value is greater than or equal to the screen' rect bottom attribute if an alien reaches the bottomwe call ship_hit(if one alien hits the bottomthere' no need to check the restso we break out of the loop after calling ship_hit(we call check_aliens_bottom(after updating the positions of all the aliens and after looking for alien-ship collisions now new fleet will appear every time the ship is hit by an alien or an alien reaches the bottom of the screen game overalien invasion feels more complete nowbut the game never ends the value of ships_left just grows increasingly negative let' add game_active flag as an attribute to gamestats to end the game when the player runs out of shipsgame_stats py def __init__(selfsettings)--snip-start alien invasion in an active state self game_active true