Skip to content

Commit 15722d2

Browse files
authored
Update result.py
MIsc Signed-off-by: AlexCami1902 <alexiocam07@gmail.com>
1 parent 955f221 commit 15722d2

File tree

1 file changed

+5
-7
lines changed

1 file changed

+5
-7
lines changed

result.py

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -2,13 +2,11 @@
22
import sys
33
import time
44
import shared
5+
pygame.init()
6+
screen = pygame.display.set_mode([600, 500])
57
pygame.display.set_caption(f"Result")
68
print(f"Received Data -> Home: {shared.home_team}, Away: {shared.away_team}, Location: {shared.match_location}") # Testing reciept of score
79

8-
9-
pygame.init()
10-
11-
screen = pygame.display.set_mode([600, 500])
1210
white = (255, 255, 255)
1311
black = (0, 0, 0)
1412
green = (0, 255, 0)
@@ -38,11 +36,11 @@ def draw_text(text, font, color, surface, x, y):
3836

3937
# Constantly monotoring the scores to see if there is a winner
4038
if first_innings_score > second_innings_score:
41-
draw_text(f"{shared.first_batting_team} Wins! ({first_innings_score} Runs vs {second_innings_score} Runs)", font, green, screen, 50, 50)
39+
draw_text(f" {shared.first_batting_team} Wins! ({first_innings_score} Runs vs {second_innings_score} Runs) ", font, green, screen, 50, 50)
4240
elif second_innings_score > first_innings_score:
43-
draw_text(f"{shared.second_batting_team} Wins! ({second_innings_score} Runs vs {first_innings_score} Runs)", font, green, screen, 50, 50)
41+
draw_text(f" {shared.second_batting_team} Wins! ({second_innings_score} Runs vs {first_innings_score} Runs) ", font, green, screen, 50, 50)
4442
else:
45-
draw_text(f"It's a Draw! ({first_innings_score} Runs vs {second_innings_score} Runs)", font, green, screen, 50, 50)
43+
draw_text(f" It's a Draw! ({first_innings_score} Runs vs {second_innings_score} Runs) ", font, green, screen, 50, 50)
4644

4745
for event in pygame.event.get():
4846
if event.type == pygame.QUIT:

0 commit comments

Comments
 (0)