day 23 - crossroads game
This commit is contained in:
23
023/scoreboard.py
Normal file
23
023/scoreboard.py
Normal 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)
|
||||
Reference in New Issue
Block a user