-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathscoreboard.py
More file actions
33 lines (27 loc) · 881 Bytes
/
scoreboard.py
File metadata and controls
33 lines (27 loc) · 881 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
32
33
from turtle import Turtle
import time
class Board(Turtle):
def __init__(self):
super().__init__()
self.point = 0
self.ht()
self.penup()
self.color('white')
self.goto(135,-290)
self.write(f"{self.point}", font=('Arial', 18, 'normal'))
def getpoint(self):
self.point += 20
self.write_point()
def write_point(self):
self.goto(135,-290)
self.clear()
self.write(f"{self.point}", font=('Arial', 18, 'normal'))
def next_level(self):
self.goto(-50,0)
self.clear()
self.write(f"Next Level", font=('Arial', 18, 'normal'))
time.sleep(0.5)
self.write_point()
def game_over(self):
self.goto(-50,0)
self.write(f"You Lose!", font=('Arial', 18, 'normal'))