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'))