Updated scoreboard.
This commit is contained in:
parent
67d2315cef
commit
21c0795ea9
@ -42,7 +42,7 @@ class scoreboard():
|
|||||||
try:
|
try:
|
||||||
localConfig.add_section("scoreboard")
|
localConfig.add_section("scoreboard")
|
||||||
except:
|
except:
|
||||||
pass
|
speak("Could not create scoreboard.")
|
||||||
self.score = startingScore
|
self.score = startingScore
|
||||||
self.oldScores = []
|
self.oldScores = []
|
||||||
for i in range(1, 11):
|
for i in range(1, 11):
|
||||||
@ -60,7 +60,7 @@ class scoreboard():
|
|||||||
try:
|
try:
|
||||||
write_config()
|
write_config()
|
||||||
except:
|
except:
|
||||||
pass
|
speak("Could not update configuration file."
|
||||||
|
|
||||||
def Decrease_Score(self, points = 1):
|
def Decrease_Score(self, points = 1):
|
||||||
self.score -= points
|
self.score -= points
|
||||||
@ -84,7 +84,7 @@ class scoreboard():
|
|||||||
for i, j in enumerate(self.oldScores):
|
for i, j in enumerate(self.oldScores):
|
||||||
if self.score > j:
|
if self.score > j:
|
||||||
# Move the old high score down the list
|
# Move the old high score down the list
|
||||||
if i < 10:
|
if i < 9:
|
||||||
self.oldScores[i + 1] = j
|
self.oldScores[i + 1] = j
|
||||||
self.oldScores[i] = self.score
|
self.oldScores[i] = self.score
|
||||||
break
|
break
|
||||||
|
Loading…
Reference in New Issue
Block a user