prep_ships(when new game starts we do this in check_play_button(in game_functions pygame_ functions py def check_play_button(ai_settingsscreenstatssbplay_buttonshipaliensbulletsmouse_xmouse_y)"""start new game when the player clicks play ""button_clicked play_button rect collidepoint(mouse_xmouse_yif button_clicked and not stats game_active--snip-reset the scoreboard images sb prep_score(sb prep_high_score(sb prep_level(sb prep_ships(--snip-we also call prep_ships(when ship is hit to update the display of ship images when the player loses shipgame_ def update_aliens(ai_settingsscreenstatssbshipaliensbullets)functions py --snip-look for alien-ship collisions if pygame sprite spritecollideany(shipaliens) ship_hit(ai_settingsscreenstatssbshipaliensbulletsw look for aliens hitting the bottom of the screen check_aliens_bottom(ai_settingsscreenstatssbshipaliensbulletsx def ship_hit(ai_settingsscreenstatssbshipaliensbullets)"""respond to ship being hit by alien ""if stats ships_left decrement ships_left stats ships_left - update scoreboard sb prep_ships(empty the list of aliens and bullets --snip-we first add the parameter sb to the definition of update_aliens( we then pass sb to ship_hit( and check_aliens_bottom(so each has access to the scoreboard object then we update the definition of ship_hit(to include sb we call prep_ships(after decreasing the value of ships_left yso the correct number of ships is displayed each time ship is destroyed scoring