Açıklama Yok

game_stats.py 462B

123456789101112131415
  1. class GameStats():
  2. """Track statistics for Alien Invasion."""
  3. def __init__(self, ai_settings):
  4. """Initialize statistics."""
  5. self.ai_settings = ai_settings
  6. self.reset_stats()
  7. # Start Alien Invasion in an active state.
  8. self.game_active = True
  9. def reset_stats(self):
  10. """Initialize statistics that can change during the game."""
  11. self.ships_left = self.ai_settings.ship_limit