From 3b2bcd928d1750b77e698026da829f8d3fbc3abc Mon Sep 17 00:00:00 2001 From: Storm Dragon <stormdragon2976@gmail.com> Date: Sat, 15 Mar 2025 18:29:55 -0400 Subject: [PATCH] Fixed errors in scoreboard. --- scoreboard.py | 20 ++++++++++---------- 1 file changed, 10 insertions(+), 10 deletions(-) diff --git a/scoreboard.py b/scoreboard.py index 6e673b8..a34cea4 100644 --- a/scoreboard.py +++ b/scoreboard.py @@ -73,35 +73,35 @@ class Scoreboard: # Sort high scores by score value in descending order self.highScores.sort(key=lambda x: x['score'], reverse=True) - def getScore(self): + def get_score(self): """Get current score.""" return self.currentScore - def getHighScores(self): + def get_highScores(self): """Get list of high scores.""" return self.highScores - def decreaseScore(self, points=1): + def decrease_score(self, points=1): """Decrease the current score.""" self.currentScore -= int(points) return self - def increaseScore(self, points=1): + def increase_score(self, points=1): """Increase the current score.""" self.currentScore += int(points) return self - def setScore(self, score): + def set_score(self, score): """Set the current score to a specific value.""" self.currentScore = int(score) return self - def resetScore(self): + def reset_score(self): """Reset the current score to zero.""" self.currentScore = 0 return self - def checkHighScore(self): + def check_high_score(self): """Check if current score qualifies as a high score. Returns: @@ -112,7 +112,7 @@ class Scoreboard: return i + 1 return None - def addHighScore(self, name=None): + def add_high_score(self, name=None): """Add current score to high scores if it qualifies. Args: @@ -178,7 +178,7 @@ class Scoreboard: return True @staticmethod - def hasHighScores(): + def has_high_scores(): """Check if the current game has any high scores. Returns: @@ -220,7 +220,7 @@ class Scoreboard: return False @staticmethod - def displayHighScores(): + def display_high_scores(): """Display high scores for the current game. Reads the high scores from Scoreboard class.