-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu.py
More file actions
381 lines (261 loc) · 8.57 KB
/
menu.py
File metadata and controls
381 lines (261 loc) · 8.57 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
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
#! /usr/bin/env python3
import pygame
from constants import *
import fonts
import sys
import screens
import sounds
# 1смерть+ 2тюрьма+ 3тьма+ 4бойня+ 5лже-догмы+ 6гностик 7позитивные догмы+ 8иное+
timer = pygame.time.Clock ()
menu_text = " Нажмите SPACE"
start_screen = pygame.Surface((840, 630))
intro_screen = pygame.Surface((600, 370))
def menu_loop ():
done1 = True
time = 0
x = 225
up = True
pygame.mixer.music.load ('music/intro.ogg')
pygame.mixer.music.set_volume (0.4)
pygame.mixer.music.play ()
main_image = pygame.image.load ('images/main_pic_de.gif')
text_image = pygame.image.load ('images/logo_text.gif')
while done1:
for e in pygame.event.get ():
if e.type == pygame.QUIT:
sys.exit ()
if e.type == pygame.KEYDOWN:
if e.key == pygame.K_SPACE:
done1 = False
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (300, 510))
start_screen.blit(screens.start_screen_version_surface, (700, 570))
screens.start_screen_text_surface.fill ((black))
screens.start_screen_text_surface.blit(fonts.font2.render (menu_text,True, (x,x,x)), (10,10))
screens.start_screen_version_surface.fill ((black))
screens.start_screen_version_surface.blit(fonts.font3.render (version,True, (200,200,200)), (50,10))
start_screen.blit (main_image, (120, 40))
start_screen.blit (text_image, (120, 430))
if up == True:
x = x - 5
if up == False:
x = x + 5
if x > 210:
up = True
if x < 10:
up = False
timer.tick (30)
time = time + 1
pygame.display.update()
def load ():
pygame.mixer.music.load ('music/lel.ogg')
pygame.mixer.music.set_volume (0.2)
pygame.mixer.music.play ()
done1 = True
time = 0
x = 225
up = True
while time < 5:
time = time+1
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (320, 310))
screens.start_screen_text_surface.fill ((black))
screens.start_screen_text_surface.blit(fonts.font2.render (" ЗАГРУЗКА ...",True, (x,x,x)), (10,10))
pygame.display.update()
def pause ():
done1 = True
time = 0
x = 225
up = True
while time < 10:
time = time+1
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (320, 310))
screens.start_screen_text_surface.fill ((black))
#screens.start_screen_text_surface.blit(fonts.font2.render (" ЗАГРУЗКА ...",True, (x,x,x)), (10,10))
pygame.display.update()
text1 = 'В начале сотворил Бог небо и землю...'
#stroke_compendium = [str() for x in range(6)]
def splittext (text):
splitted_by_space = text.split(' ')
current_stroke = 0
stroke_compendium = [str() for x in range(6)]
for wort in splitted_by_space:
if len(stroke_compendium[current_stroke]+' '+wort)<48:
stroke_compendium[current_stroke] = stroke_compendium[current_stroke]+' '+wort
else:
current_stroke+=1
stroke_compendium[current_stroke] = stroke_compendium[current_stroke]+' '+wort
return stroke_compendium
def experiment_loop (text, pic, end_black = False, pic_x = 50, pic_y = 20, time_scroll = 10000, speed_mod = 3):
done1 = True
time = 0
x = 225
up = True
time2 = 0
count = 0
sound1 = pygame.mixer.Sound('sound/7.ogg')
sound1.set_volume(0.1)
time3 = 0
end = False
intro = pygame.image.load (pic)
text_to_print_compendium = [str() for x in range(6)]
stroke_compendium = splittext (text)
time4 = 0
while done1:
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit (intro_screen, (120,20))
intro_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (560, 570))
screens.start_screen_text_surface.fill ((black))
start_screen.blit (screens.text_intro_screen, (120, 430))
screens.text_intro_screen.fill ((black))
intro_screen.blit (intro, (pic_x, pic_y-time2))
text2 = text1[:time2]
if end != True:
try:
if stroke_compendium[count][time3-1] != ' ':
sound1.play()
except:
pass
if end == True:
screens.start_screen_text_surface.blit(fonts.font2.render (" SPACE ",True, (x,x,x)), (10,10))
text_to_print_compendium[count] = stroke_compendium[count][:time3]
if len(stroke_compendium[count])<time3:
if len(stroke_compendium)>count+1:
count +=1
time3 = 0
time4 = 0
else:
end = True
for i in range(6):
screens.text_intro_screen.blit(fonts.underdog.render (text_to_print_compendium[i], True, (white)), (10,10+i*20))
if up == True:
x = x - 5
if up == False:
x = x + 5
if x > 210:
up = True
if x < 10:
up = False
timer.tick (30)
time4 = time4 + 1
time = time + 1
time3 = time3 + 2
if time2 < time_scroll:
time2 = int(time//speed_mod)
for e in pygame.event.get ():
if e.type == pygame.QUIT:
sys.exit ()
if e.type == pygame.KEYDOWN:
if e.key == pygame.K_SPACE:
done1 = False
# if end_black == True:
# screens.window.blit(start_screen, (10, 10))
# start_screen.fill ((black))
# start_screen.blit(screens.start_screen_text_surface, (300, 510))
# screens.start_screen_text_surface.fill ((black))
#
# screens.start_screen_text_surface.blit(fonts.font2.render ("ЗАГРУЗКА...",True, (255,255,255)), (10,10))
pygame.display.update()
def help_loop ():
done1 = True
time = 0
x = 225
up = True
main_image = pygame.image.load ('images/control.png')
while done1:
for e in pygame.event.get ():
if e.type == pygame.QUIT:
sys.exit ()
if e.type == pygame.KEYDOWN:
if e.key == pygame.K_SPACE:
done1 = False
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (300, 500))
start_screen.blit (main_image, (170, 100))
screens.start_screen_text_surface.fill ((black))
screens.start_screen_text_surface.blit(fonts.font2.render (menu_text,True, (x,x,x)), (10,10))
if up == True:
x = x - 5
if up == False:
x = x + 5
if x > 210:
up = True
if x < 10:
up = False
timer.tick (30)
time = time + 1
pygame.display.update()
def ending (text, pic, end_num, end_black = False, pic_x = 50, pic_y = 20, time_scroll = 10000, speed_mod = 3):
done1 = True
time = 0
x = 225
up = True
time2 = 0
count = 0
sound1 = sounds.prints
time3 = 0
end = False
intro = pygame.image.load (pic)
text_to_print_compendium = [str() for x in range(6)]
stroke_compendium = splittext (text)
time4 = 0
while done1:
screens.window.blit(start_screen, (10, 10))
start_screen.fill ((black))
start_screen.blit (intro_screen, (120,20))
intro_screen.fill ((black))
start_screen.blit(screens.start_screen_text_surface, (560, 570))
start_screen.blit(screens.start_screen_version_surface, (320, 400))
screens.start_screen_text_surface.fill ((black))
screens.start_screen_version_surface.fill ((black))
start_screen.blit (screens.text_intro_screen, (120, 430))
screens.text_intro_screen.fill ((black))
intro_screen.blit (intro, (pic_x, pic_y-time2))
text2 = text1[:time2]
if end != True:
try:
if stroke_compendium[count][time3-1] != ' ':
sound1.play()
except:
pass
screens.start_screen_version_surface.blit(fonts.underdog.render ("КОНЦОВКА № %d" % end_num,True, (200,200,200)), (10,0))
if end == True:
screens.start_screen_text_surface.blit(fonts.font2.render (" Нажмите ESC ",True, (x,x,x)), (10,10))
text_to_print_compendium[count] = stroke_compendium[count][:time3]
if len(stroke_compendium[count])<time3:
if len(stroke_compendium)>count+1:
count +=1
time3 = 0
time4 = 0
else:
end = True
for i in range(6):
screens.text_intro_screen.blit(fonts.underdog.render (text_to_print_compendium[i], True, (white)), (10,10+i*20))
if up == True:
x = x - 5
if up == False:
x = x + 5
if x > 210:
up = True
if x < 10:
up = False
timer.tick (30)
time4 = time4 + 1
time = time + 1
time3 = time3 + 2
if time2 < time_scroll:
time2 = int(time//speed_mod)
for e in pygame.event.get ():
if e.type == pygame.QUIT:
sys.exit ()
if e.type == pygame.KEYDOWN:
if e.key == pygame.K_ESCAPE:
sys.exit ()
pygame.display.update()