diff --git a/Color_Game/highest_score.txt b/Color_Game/highest_score.txt index 7813681f..9d607966 100644 --- a/Color_Game/highest_score.txt +++ b/Color_Game/highest_score.txt @@ -1 +1 @@ -5 \ No newline at end of file +11 \ No newline at end of file diff --git a/Color_Game/highest_score1.txt b/Color_Game/highest_score1.txt new file mode 100644 index 00000000..c7930257 --- /dev/null +++ b/Color_Game/highest_score1.txt @@ -0,0 +1 @@ +7 \ No newline at end of file diff --git a/Color_Game/main.py b/Color_Game/main.py index 4d1e68d9..836c2405 100644 --- a/Color_Game/main.py +++ b/Color_Game/main.py @@ -21,7 +21,6 @@ def next_colour(): label.config(fg=colours[1], text=colours[0]) score_label.config(text=f"Score: {score}") - def countdown(): global timeleft if timeleft > 0: @@ -38,6 +37,11 @@ def record_highest_score(): if score > highest_score: with open("highest_score.txt", "w") as file: file.write(str(score)) + elif score <= highest_score: + with open("highest_score1.txt", "w") as file: + file.write(str(score)) + + @@ -49,20 +53,36 @@ def load_highest_score(): return int(data) else: return 0 + + except FileNotFoundError: + return 0 + +def load_your_score(): + try: + with open("highest_score1.txt", "r") as file: + data = file.read() + if data: + return int(data) + else: + return 0 except FileNotFoundError: return 0 + def scoreshow(): record_highest_score() - window2 = tk.Tk() + window2 = tk.Toplevel() window2.title("HIGH SCORE") window2.geometry("300x200") - label = tk.Label(window2, text=f"Highest Score: {load_highest_score()}",font=(font, 12)) + highest_label = tk.Label(window2, text=f"Highest Score: {load_highest_score()}",font=(font, 12)) - label.pack() + your_label = tk.Label(window2, text=f"Your Score:{load_your_score()}", font=(font, 12)) + highest_label.pack() + your_label.pack() + window2.mainloop() def start_game(event): @@ -74,8 +94,8 @@ def start_game(event): window = tk.Tk() font = 'Helvetica' window.title("Color Game") -window.iconbitmap("color_game_icon.ico") -window.geometry("375x250") +# window.iconbitmap("color_game_icon.ico") +window.geometry("375x350") window.resizable(False, False) instructions = tk.Label(window, text="Enter the color of the text, not the word!", font=(font, 12)) @@ -96,4 +116,5 @@ def start_game(event): e.focus_set() -window.mainloop() \ No newline at end of file +window.mainloop() + diff --git a/NASA_Image_Extraction/Astro_Images/2022-11-25_NGC 6744 b/NASA_Image_Extraction/Astro_Images/2022-11-25_NGC 6744 new file mode 100644 index 00000000..e69de29b diff --git a/NASA_Image_Extraction/Astro_Images/2022-11-25_NGC 6744: Extragalactic Close-Up.mp3 b/NASA_Image_Extraction/Astro_Images/2022-11-25_NGC 6744: Extragalactic Close-Up.mp3 deleted file mode 100644 index f5611fcf..00000000 Binary files a/NASA_Image_Extraction/Astro_Images/2022-11-25_NGC 6744: Extragalactic Close-Up.mp3 and /dev/null differ