-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMenu
More file actions
95 lines (87 loc) · 3.44 KB
/
Menu
File metadata and controls
95 lines (87 loc) · 3.44 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
import pygame
pygame.font.init()
fon = pygame.image.load('Fon.png')
fon.set_colorkey((255, 255, 255))
ns = pygame.image.load('ns.png')
ns.set_colorkey((255, 255, 255))
shes = pygame.image.load('shes.png')
shes.set_colorkey((255, 255, 255))
learn = pygame.image.load('learn.png')
learn.set_colorkey((255, 255, 255))
play_a_l = pygame.image.load('play_a_l.png')
play_a_l.set_colorkey((255, 255, 255))
fon_shes = pygame.image.load('Fonshes.png')
fon_shes.set_colorkey((255, 255, 255))
open_1 = 0
if __name__ == '__main__':
pygame.init()
pygame.display.set_caption('Вступительное окно')
size = width, height = 1170, 650
screen = pygame.display.set_mode(size)
screen_shes = pygame.display.set_mode(size)
x_pos, y_pos = 0, 0
main_win = True
o_w = fon.get_rect(
topleft=(0, 0))
screen.blit(fon, o_w)
o_w1 = shes.get_rect(
topleft=(width - 120, 5))
o_w2 = ns.get_rect(
topleft=(width // 2 - 180, 500))
o_w3 = learn.get_rect(
topleft=(width // 2 - 520, 500))
o_w4 = play_a_l.get_rect(
topleft=(width // 2 + 190, 500))
fs = fon_shes.get_rect(
topleft=(0, 0))
screen.blit(fon_shes, fs)
running = True
while running:
for event in pygame.event.get():
if event.type == pygame.QUIT:
running = False
if open_1 == 0:
o_w = fon.get_rect(
topleft=(0, 0))
screen.fill('white')
screen.blit(fon, o_w)
o_w1 = shes.get_rect(
topleft=(width - 120, 5))
screen.blit(shes, o_w1)
o_w2 = ns.get_rect(
topleft=(width // 2 - 180, 500))
screen.blit(ns, o_w2)
o_w3 = learn.get_rect(
topleft=(width // 2 - 520, 500))
screen.blit(learn, o_w3)
o_w4 = play_a_l.get_rect(
topleft=(width // 2 + 190, 500))
screen.blit(play_a_l, o_w4)
if event.type == pygame.MOUSEBUTTONUP:
x_pos, y_pos = event.pos
if x_pos in list(range(width - 120, width + 100)) and y_pos in list(range(5, 105)):
open_1 = 1
if x_pos in list(range(width // 2 - 180, width // 2 + 140)) and y_pos in list(range(400, 600)):
print('2')
if x_pos in list(range(width // 2 - 520, width // 2 - 200)) and y_pos in list(range(400, 600)):
print('3')
if x_pos in list(range(width // 2 + 190, width // 2 + 520)) and y_pos in list(range(400, 600)):
print('4')
elif open_1 == 1:
fs = fon_shes.get_rect(
topleft=(0, 0))
screen_shes.fill('white')
screen_shes.blit(fon_shes, fs)
fsс = pygame.font.SysFont('serif', 48)
complexity = fsс.render("Сложность:", True, (0, 0, 0))
screen_shes.blit(complexity, (10, 50))
fsa = pygame.font.SysFont('serif', 48)
achievement = fsa.render("Достижения:", True, (0, 0, 0))
screen_shes.blit(achievement, (10, 200))
fss = pygame.font.SysFont('serif', 48)
sound = fss.render("Звук:", True, (0, 0, 0))
screen_shes.blit(sound, (275, 500))
if x_pos in list(range(width // 2 - 500, width // 2 - 100)) and y_pos in list(range(10, 110)):
print('1.1')
pygame.display.flip()
pygame.quit()