更新 'scoreboard.py'

This commit is contained in:
206530222 2021-06-22 22:39:06 +08:00
parent 90ca41db19
commit 1095151039
1 changed files with 0 additions and 17 deletions

View File

@ -15,12 +15,6 @@ class Scoreboard:
self.text_color = (30, 30, 30)
self.font = pygame.font.SysFont(None, 48)
# """准备包含最高得分和当前得分的图像"""
self.prep_score()
self.prep_high_score()
self.prep_level()
self.prep_ships()
def prep_score(self):
#"""将得分转换为一幅渲染的图像"""
rounded_score = round(self.stats.score, -1)
@ -40,17 +34,6 @@ class Scoreboard:
self.screen.blit(self.level_image, self.level_rect)
self.ships.draw(self.screen)
def prep_high_score(self):
#"""将最高得分转换为渲染的图像"""
high_score = round(self.stats.high_score, -1)
high_score_str = "{:,}".format(high_score)
self.high_score_image = self.font.render(high_score_str, True,
self.text_color, self.settings.bg_color)
# """将最高得分放在屏幕顶部中央"""
self.high_score_rect = self.high_score_image.get_rect()
self.high_score_rect.centerx = self.screen_rect.centerx
self.high_score_rect.top = self.score_rect.top
def check_high_score(self):
#"""检查是否诞生了新的最高得分"""