-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscoreboard.py
More file actions
31 lines (26 loc) · 791 Bytes
/
scoreboard.py
File metadata and controls
31 lines (26 loc) · 791 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
from turtle import Turtle
class Scoreboard(Turtle):
def __init__(self):
super().__init__()
self.left_score = 0
self.right_score = 0
self.color("white")
# self.center_line()
self.up()
self.hideturtle()
self.goto(0, 260)
# def center_line(self):
# self.up()
# self.goto(0, -300)
# self.setheading(90)
# while self.ycor() < 260:
# self.down()
# self.forward(20)
# self.up()
# self.forward(20)
def show_score(self):
self.clear()
self.write(f"{self.left_score} | {self.right_score}",
False,
"center",
("Arial", 24, "normal"))