From 5e851915d81e97f3d2fc5f03794832a9626c8017 Mon Sep 17 00:00:00 2001 From: pl3g9npaj <18798213833@163.com> Date: Sun, 7 Nov 2021 08:45:25 +0800 Subject: [PATCH] ADD file via upload --- game_stats.py | 19 +++++++++++++++++++ 1 file changed, 19 insertions(+) create mode 100644 game_stats.py diff --git a/game_stats.py b/game_stats.py new file mode 100644 index 0000000..7598ffd --- /dev/null +++ b/game_stats.py @@ -0,0 +1,19 @@ +class GameStats(): + """靶子的统计数据""" + + def __init__(self, ai_settings): + """初始化统计信息""" + self.ai_settings = ai_settings + self.reset_stats() + + # 在非活动状态下开始游戏 + self.game_active = False + + # 高分不应重置。 + self.high_score = 0 + + def reset_stats(self): + """初始化游戏期间可能更改的统计信息""" + self.mans_left = self.ai_settings.man_limit + self.score = 0 + self.level = 1