day 23 - crossroads game

This commit is contained in:
Tanguy Deleplanque
2025-07-16 14:17:51 +02:00
parent 697d53f836
commit 59a3d6d830
4 changed files with 127 additions and 0 deletions

23
023/scoreboard.py Normal file
View File

@ -0,0 +1,23 @@
from turtle import Turtle
class Scoreboard(Turtle):
FONT = ("Courier", 24, "normal")
def __init__(self):
super().__init__()
self.color("black")
self.pu()
self.hideturtle()
self.goto(-280, 260)
self.level = 1
self.update_score(self.level)
def update_score(self, level):
self.clear()
self.write(f"Level: {level}", False, align="left", font=self.FONT)
def game_over(self):
self.goto(0,0)
self.write("GAME OVER", False, align="center", font=self.FONT)