-
Notifications
You must be signed in to change notification settings - Fork 0
/
score.py
100 lines (85 loc) · 2.34 KB
/
score.py
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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
from turtle import Turtle
class Scoreboard_player1(Turtle):
def __init__(self):
super().__init__()
self.score1 = 0
def make_score1(self):
self.color("blue")
self.penup()
self.goto(-100, 390)
self.hideturtle()
def increase_score(self):
self.score1 += 1
def count_score1(self):
self.clear()
self.write(f'Score : {self.score1}', font=("normal", 30, "bold"))
class Scoreboard_player2(Turtle):
def __init__(self):
super().__init__()
self.score2 = 0
def make_score1(self):
self.color("blue")
self.penup()
self.goto(80, 390)
self.hideturtle()
def increase_score(self):
self.score2 += 1
def count_score1(self):
self.clear()
self.write(f'| {self.score2}', font=("normal", 30, "bold"))
class Border(Turtle):
def __init__(self):
super().__init__()
def make_border(self):
self.penup()
self.color("white")
self.hideturtle()
self.goto(0,290)
self.setheading(270)
self.speed("fastest")
for i in range(40):
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.setheading(0)
for i in range(50):
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.goto(0, -290)
for i in range(50):
self.color("red")
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.goto(0 ,290)
for i in range(50):
self.color("red")
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.goto(0 ,290)
self.setheading(180)
for i in range(50):
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.goto(0, -290)
for i in range(50):
self.color("red")
self.pendown()
self.forward(10)
self.penup()
self.forward(10)
self.goto(0, 290)
for i in range(50):
self.color("red")
self.pendown()
self.forward(10)
self.penup()
self.forward(10)