-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathgame_stats.py
More file actions
23 lines (18 loc) · 768 Bytes
/
game_stats.py
File metadata and controls
23 lines (18 loc) · 768 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
"""Służy do monitorowania danych statystycznych dla gry."""
class GameStats:
"""Monitorowanie danych statystycznych w grze 'Inwazja obcych'."""
def __init__(self, ai_settings):
"""Inicjalizacja danych statystycznych.
:param ai_settings: Ustawienia
"""
self.ai_settings = ai_settings
# Najlepszy wynik nigdy nie powinien zostać wyzerowany
self.high_score = 0
self.reset_stats()
# Uruchomienie gry "Inwazja obcych" w stanie nieaktywnym
self.game_active = False
def reset_stats(self):
"""Inicjalizacja danych statystycznych, które mogą zmieniać się w trakcie gry."""
self.ships_left = self.ai_settings.ship_limit
self.score = 0
self.level = 1