(ai_settings, screen, ship, bullets):
"""如果还没有到达限制,就发射一颗子弹"""
# 创建一颗子弹,并将其加入到编组bullets中
if len(bullets...) < ai_settings.bullets_allowed:
new_bullet = Bullet(ai_settings, screen, ship)
bullets.add(new_bullet...(ai_settings, screen, stats, sb, ship, aliens, bullets):
"""更新子弹位置,并删除已消失的子弹"""
# 更新子弹位置
bullets.update...screen
self.screen_rect = screen.get_rect()
self.ai_settings = ai_settings
self.stats = stats
# 显示得分信息时使用的字体设置...0, 255, 0) # 亮绿色
self.text_color = (255, 255, 255) # 白色
self.font = pygame.font.SysFont(None, 48) # 使用默认