上传文件至 'game_stats'

This commit is contained in:
206530110 2021-06-22 13:59:54 +08:00
parent 17006a71e0
commit e31fe70aeb
1 changed files with 12 additions and 0 deletions

12
game_stats/game_stats.py Normal file
View File

@ -0,0 +1,12 @@
class GameStats():
def __init__(self, ai_settings):
self.ai_settings = ai_settings
self.reset_stats()
self.game_active = False
# 初始化在游戏运行期间可能变化的统计信息
def reset_stats(self):
self.ships_left = self.ai_settings.ship_limit
self.score = 0
self.high_score = 0
self.level = 1