Files
python_bootcamp/022/score.py
2025-07-16 12:47:31 +02:00

18 lines
508 B
Python

from turtle import Turtle
class Score(Turtle):
def __init__(self, x_pos):
super().__init__()
self.score = 0
self.color("white")
self.hideturtle()
self.pu()
self.goto(x=x_pos, y=270)
self.write(self.score, move=False, align='center', font=('Arial', 24, 'normal'))
def increment(self):
self.score += 1
def update(self):
self.clear()
self.write(self.score, move=False, align='center', font=('Arial', 24, 'normal'))