Преглед на файлове

working on highest score and computing current power level

MrCypher преди 7 месеца
родител
ревизия
bbb2b7ec61
променени са 1 файла, в които са добавени 9 реда и са изтрити 5 реда
  1. 9 5
      GUI.py

+ 9 - 5
GUI.py

@@ -30,12 +30,16 @@ def getCurrentScore():
 
 
 currentScore = getCurrentScore()
-highestScore = 0
+highestScore = 100
+highScoreName = ""
 
-if currentScore < highestScore :
+
+if currentScore > highestScore :
     highestScore = currentScore
     f = open("scores.txt", "rw")
-    f.write(highestScore)
+    f.write(highestScore + highScoreName)
+    scores.append(highestScore)
+    names.append(highScoreName)
 
 
 async def main():
@@ -52,8 +56,8 @@ canvas.config(background="white")
 canvas.place(x=0,y=0)
 
 
-names = ["one","two","three","four","five"]
-scores = [1,2,3,4,5]
+names = []
+scores = []
 
 def placeLeaderboard():
     canvas.create_rectangle(0, 0, 500, 500, fill="grey20", width=2) #grey14 to match background