From eacc58c7daf2adc733e6c623d338d59f019a50b6 Mon Sep 17 00:00:00 2001 From: 206530235 <1828358204@qq.com> Date: Thu, 24 Jun 2021 21:27:16 +0800 Subject: [PATCH] =?UTF-8?q?=E5=88=A0=E9=99=A4=20'=E6=B8=B8=E6=88=8F?= =?UTF-8?q?=E7=BB=93=E6=9D=9F3'?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- 游戏结束3 | 36 ------------------------------------ 1 file changed, 36 deletions(-) delete mode 100644 游戏结束3 diff --git a/游戏结束3 b/游戏结束3 deleted file mode 100644 index 5e55c28..0000000 --- a/游戏结束3 +++ /dev/null @@ -1,36 +0,0 @@ -class GameSta(): - def __init__(self,ai_settings): - self.ai_settings=ai_settings - self.reset_sta() - self.game_active=True - def reset_sta(self): - self.ship_counts=self.ai_settings.ship_limit - self.ship_limit=3 -from game_sta import GameSta - sta=GameSta(ai_settings) - gf.update_aliens(ai_settings,aliens,screen,ship,bullets,sta) - - -def ship_col(ai_settings, aliens, screen, ship, bullets, sta): - if sta.ship_counts > 0: - sta.ship_counts -= 1 - aliens.empty() - bullets.empty() - creat_aliens(ai_settings, screen, aliens, ship) - ship.ship_center() - sleep(1) - else: - sta.game_active = False -def check_aliens_bottom(ai_settings, aliens, screen, ship, bullets, sta): - for alien in aliens.sprites(): - if alien.rect.bottom >= screen.get_rect().bottom: - ship_col(ai_settings, aliens, screen, ship, bullets, sta) - break -def update_aliens(ai_settings, aliens, screen, ship, bullets, sta): - check_aliens_edge(ai_settings, aliens) - aliens.update() - if pygame.sprite.spritecollideany(ship, aliens): - ship_col(ai_settings, aliens, screen, ship, bullets, sta) - check_aliens_bottom(ai_settings, aliens, screen, ship, bullets, sta) -def ship_center(self): - self.center = self.screen_rect.centerx \ No newline at end of file