Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- from turtle import Turtle
- class Scoreboard(Turtle):
- def __init__(self):
- super().__init__()
- self.score = 0
- self.color("white")
- self.hideturtle()
- self.penup()
- self.goto(0, 265)
- self.update_scoreboard()
- def update_scoreboard(self):
- self.write(f"Score = {self.score}", align="center", font=("Courier", 24, "normal"))
- def increase_score(self):
- self.score += 1
- self.clear()
- self.update_scoreboard()
- def game_over(self):
- self.goto(0, 0)
- self.write("GAME OVER", align="center", font=("Courier", 24, "normal"))
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement