Curso_Intensivo_de_PYTHON/chapter_14/leveling_up/game_stats.py
2023-06-02 17:22:53 +02:00

14 lines
No EOL
439 B
Python

class GameStats:
"""Track statistics for Alien Invasion."""
def __init__(self, ai_game):
"""Initialize statistics."""
self.settings = ai_game.settings
self.reset_stats()
# Start game in an inactive state.
self.game_active = False
def reset_stats(self):
"""Initialize statistics that can change during the game."""
self.ships_left = self.settings.ship_limit