-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathB_initial_screen.py
More file actions
108 lines (102 loc) · 4.3 KB
/
B_initial_screen.py
File metadata and controls
108 lines (102 loc) · 4.3 KB
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
97
98
99
100
101
102
103
104
105
106
107
108
from BA_curved_icon import *
from C_solver import *
from D_generator import *
color_dark = (75,75,75)
color_white = (255,255,255)
largefont = pygame.font.SysFont('Corbel',28)
text_easy = largefont.render('Easy' , True , color_white)
text_medium = largefont.render('Medium' , True , color_white)
text_hard = largefont.render('Hard' , True , color_white)
text_level = largefont.render('Hey! Please choose the LEVEL for sudoku Solver:' ,True ,color_dark)
text_generator_level = largefont.render('Hey! Please choose the LEVEL for sudoku Generator:' , True , color_dark)
def initial_screen(
screen,
background,
color_light,
color_blue,
color_green,
color_red_hover,
color_red,
color_yellow,
text_solver,
text_generator,
text_quit,
text_team
):
#buttons for screen
def button(mouse):
if 183<=mouse[0]<=483 and 200<=mouse[1]<=290:
AAfilledRoundedRect(screen,(183, 200, 300, 90),color_light,0.8)
AAfilledRoundedRect(screen,(183, 320, 300, 90),color_green,0.8)
AAfilledRoundedRect(screen,(263, 635, 140, 65),color_red,0.8)
elif 183<=mouse[0]<=483 and 320<=mouse[1]<=410:
AAfilledRoundedRect(screen,(183, 200, 300, 90),color_blue,0.8)
AAfilledRoundedRect(screen,(183, 320, 300, 90),color_light,0.8)
AAfilledRoundedRect(screen,(263, 635, 140, 65),color_red,0.8)
elif 263<=mouse[0]<=403 and 635<=mouse[1]<=700:
AAfilledRoundedRect(screen,(183, 200, 300, 90),color_blue,0.8)
AAfilledRoundedRect(screen,(183, 320, 300, 90),color_green,0.8)
AAfilledRoundedRect(screen,(263, 635, 140, 65),color_red_hover,0.8)
else:
AAfilledRoundedRect(screen,(183, 200, 300, 90),color_blue,0.8)
AAfilledRoundedRect(screen,(183, 320, 300, 90),color_green,0.8)
AAfilledRoundedRect(screen,(263, 635, 140, 65),color_red,0.8)
while True:
screen.fill((0,0,0))
screen.fill([255, 255, 255])
screen.blit(background, ( 0,0 ))
#stores the (x,y) coordinates into the variable as a tuple
mouse = pygame.mouse.get_pos()
button(mouse)
#superimposing the text onto our button
screen.blit(text_solver, (257, 232))
screen.blit(text_generator, (232, 352))
screen.blit(text_quit, (309, 655))
screen.blit(text_team, (244, 737))
for ev in pygame.event.get():
if ev.type == pygame.QUIT:
pygame.quit()
if ev.type == pygame.MOUSEBUTTONDOWN:
if 263<=mouse[0]<=403 and 635<=mouse[1]<=700:
pygame.quit()
if 183<=mouse[0]<=483 and 200<=mouse[1]<=290:
s_solver(
screen,
background,
color_white,
color_light,
color_dark,
color_blue,
color_green,
color_red_hover,
color_red,
color_yellow,
text_level,
text_easy,
text_medium,
text_hard,
text_quit,
text_team,
largefont
)
if 183<=mouse[0]<=483 and 320<=mouse[1]<=410:
generator(
screen,
background,
color_white,
color_light,
color_dark,
color_blue,
color_green,
color_red_hover,
color_red,
color_yellow,
text_generator_level,
text_easy,
text_medium,
text_hard,
text_quit,
text_team,
largefont
)
pygame.display.update()