This repository was archived by the owner on Aug 11, 2025. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathMT.py
More file actions
3055 lines (2912 loc) · 145 KB
/
MT.py
File metadata and controls
3055 lines (2912 loc) · 145 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
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
import os
import pygame as pg
import random as rand
import webbrowser as web
import pyperclip
import time
import sys
os.environ['PYGAME_HIDE_SUPPORT_PROMPT'] = "hide"
def shifr(shifr):
"Unshifr code"
return result
def unshifr(shifr):
"Shifering code"
return result
def rand_num(numb):
"add salt"
return result
def rand_shifr(sett):
result = ''
vi = rand.randint(1, 2)
if vi == 1:
for i in range(len(sett)):
amount = rand.randint(10, 200)
for j in range(amount):
result += rand_num(rand.randint(1, 50))
result += unshifr(sett[i])
else:
for i in range(len(sett)):
result += unshifr(sett[i])
amount = rand.randint(10, 200)
for h in range(amount):
result += rand_num(rand.randint(1, 50))
return result
def input_settings():
setup_file = open('bd/sett.dat', 'r')
size_display = int(shifr(setup_file.readline()))
score = shifr(setup_file.readline())
theme = int(shifr(setup_file.readline()))
ex_1 = int(shifr(setup_file.readline()))
ex_2 = int(shifr(setup_file.readline()))
rec = int(shifr(setup_file.readline()))
setup_file.close()
return size_display, score, theme, ex_1, ex_2, rec
def output_settings():
setup_file = open('bd/sett.dat', 'w')
setup_file.write(rand_shifr(str(SIZE)) + '\n')
setup_file.write(rand_shifr(str(SCORE)) + '\n')
setup_file.write(rand_shifr(str(THEME)) + '\n')
setup_file.write(rand_shifr(str(EX_1)) + '\n')
setup_file.write(rand_shifr(str(EX_2)) + '\n')
setup_file.write(rand_shifr(str(RECORD)) + '\n')
setup_file.close()
lg = open('bd/lg.dat', 'w')
lg.write(str(LANG))
lg.close
sys.exit()
def size_upload(size):
if size == 1:
SIZE = (800, 600)
elif size == 2:
SIZE = (1000, 700)
elif size == 3:
SIZE = (1200, 900)
return SIZE
def theme_upload(theme):
if theme == 1:
COLOR_DISPLAY = (28, 8, 161)
COLOR_BUTTON_1 = (255, 210, 0)
MAIN_COLOR_FONT = (199, 24, 24)
COLOR_BUTTON_2 = (166, 136, 0)
COLOR_BUTTON_SETUP_1 = (92, 92, 91)
COLOR_BUTTON_SETUP_2 = (66, 66, 66)
COLOR_EXIT_DRAW_1 = (66, 66, 66)
COLOR_EXIT_DRAW_2 = (105, 105, 105)
COLOR_VERSION_SCORE = (12, 247, 236)
ACTIVE_COLOR = (0, 51, 255)
ANTI_VERSION_SCORE_COLOR = (255, 255, 255)
COLOR_SETUP_MENU_1 = (71, 60, 60)
COLOR_ENTRY_TEXT = (21, 17, 36)
MAIN_FONT_COLOR_MENU_1 = (0, 0, 0)
FIRST_FIGURA = (255, 0, 0)
SECOND_FIGURE = (0, 255, 0)
THRE_FIGURE = (0, 0, 255)
elif theme == 2:
COLOR_DISPLAY = (50, 50, 50)
COLOR_BUTTON_1 = (92, 92, 91)
MAIN_COLOR_FONT = (199, 24, 24)
COLOR_BUTTON_2 = (66, 66, 66)
COLOR_BUTTON_SETUP_1 = (92, 92, 91)
COLOR_BUTTON_SETUP_2 = (66, 66, 66)
COLOR_EXIT_DRAW_1 = (66, 66, 66)
COLOR_EXIT_DRAW_2 = (105, 105, 105)
COLOR_VERSION_SCORE = (12, 247, 236)
ACTIVE_COLOR = (0, 51, 255)
ANTI_VERSION_SCORE_COLOR = (255, 255, 255)
COLOR_SETUP_MENU_1 = (71, 60, 60)
COLOR_ENTRY_TEXT = (21, 17, 36)
MAIN_FONT_COLOR_MENU_1 = (0, 0, 0)
FIRST_FIGURA = (50, 50, 50)
SECOND_FIGURE = (50, 50, 50)
THRE_FIGURE = (50, 50, 50)
elif theme == 3:
COLOR_DISPLAY = (232, 232, 232)
COLOR_BUTTON_1 = (141, 145, 214)
MAIN_COLOR_FONT = (199, 24, 24)
COLOR_BUTTON_2 = (66, 66, 66)
COLOR_BUTTON_SETUP_1 = (141, 145, 214)
COLOR_BUTTON_SETUP_2 = (66, 66, 66)
COLOR_EXIT_DRAW_1 = (66, 66, 66)
COLOR_EXIT_DRAW_2 = (105, 105, 105)
COLOR_VERSION_SCORE = (12, 247, 236)
ACTIVE_COLOR = (0, 51, 255)
ANTI_VERSION_SCORE_COLOR = (29, 30, 41)
COLOR_SETUP_MENU_1 = (71, 60, 60)
COLOR_ENTRY_TEXT = (21, 17, 36)
MAIN_FONT_COLOR_MENU_1 = (0, 0, 0)
FIRST_FIGURA = (232, 232, 232)
SECOND_FIGURE = (232, 232, 232)
THRE_FIGURE = (232, 232, 232)
return COLOR_DISPLAY, COLOR_BUTTON_1, MAIN_COLOR_FONT, COLOR_BUTTON_2, COLOR_BUTTON_SETUP_1, COLOR_BUTTON_SETUP_2, \
COLOR_EXIT_DRAW_1, COLOR_EXIT_DRAW_2, COLOR_VERSION_SCORE, ACTIVE_COLOR, ANTI_VERSION_SCORE_COLOR, COLOR_SETUP_MENU_1, \
COLOR_ENTRY_TEXT, COLOR_SETUP_MENU_1, MAIN_FONT_COLOR_MENU_1, FIRST_FIGURA, SECOND_FIGURE, THRE_FIGURE
SIZE, SCORE, THEME, EX_1, EX_2, RECORD = input_settings()
SCORE = int(SCORE)
COLOR_DISPLAY, COLOR_BUTTON_1, MAIN_COLOR_FONT, COLOR_BUTTON_2, COLOR_BUTTON_SETUP_1, COLOR_BUTTON_SETUP_2, \
COLOR_EXIT_DRAW_1, COLOR_EXIT_DRAW_2, COLOR_VERSION_SCORE, ACTIVE_COLOR, ANTI_VERSION_SCORE_COLOR, COLOR_SETUP_MENU_1, \
COLOR_ENTRY_TEXT, COLOR_SETUP_MENU_1, MAIN_FONT_COLOR_MENU_1, FIRST_FIGURE_COLOR, SECOND_FIGURE_COLOR, THRE_FIGURE_COLOR = theme_upload(
THEME)
__SIZE = size_upload(SIZE)
BLACK_COLOR = (0, 0, 0)
WHITE_COLOR = (255, 255, 255)
display = pg.display.set_mode(__SIZE)
pg.init()
pg.display.set_caption('Math Trainer')
icon = pg.image.load('image\main_icon.png')
pg.display.set_icon(icon)
lg = open('bd/lg.dat', 'r')
LANG = int(lg.readline())
lg.close()
Exit = False
class New_button:
def __init__(self, x, y, weight, height, message=None, font_color=(0, 0, 0), font_size=30,
font_type='/shrift/play_manu.otf', active_color=None,
actived_color=None, message_x=None, message_y=None, second_color=None,
sukam=4):
self.x = x
self.y = y
self.weight = weight
self.height = height
self.ms_x = message_x
self.ms_y = message_y
self.font_color = font_color
self.message = message
self.active_color = active_color
self.sukam = sukam
self.font_type = font_type
self.action = False
self.actived_color = MAIN_COLOR_FONT
self.font_size = font_size
def draw(self, color, second_color):
self.color = color
self.second_color = second_color
if pg.mouse.get_pressed()[0] == 1:
pg.time.wait(50)
mouse = pg.mouse.get_pos()
click = pg.mouse.get_pressed()
if self.x < mouse[0] < self.x + self.weight and self.y < mouse[1] < self.y + self.height:
if click[0] == 1 and self.x < mouse[0] < self.x + self.weight and self.y < mouse[1] < self.y + self.height:
if self.sukam <= 6:
rect_2 = (self.x, self.y, self.weight, self.height)
rect_1 = (self.x - self.sukam, self.y - self.sukam, self.weight + self.sukam * 2,
self.height + self.sukam * 2)
ellipse_1 = pg.draw.rect(display, self.second_color, rect_1)
el = pg.draw.rect(display, self.color, rect_2)
text_but = Font(self.ms_x, self.ms_y, self.actived_color, self.font_size,
message=self.message)
text_but.draw_text()
self.sukam += 2
else:
rect_1 = (self.x - self.sukam, self.y - self.sukam, self.weight + self.sukam * 2,
self.height + self.sukam * 2)
rect_2 = (self.x, self.y, self.weight, self.height)
el = pg.draw.rect(display, self.second_color, rect_1)
ellipse_2 = pg.draw.rect(display, self.color, rect_2)
text_but = Font(self.ms_x, self.ms_y, self.actived_color, self.font_size,
message=self.message)
text_but.draw_text()
self.action = True
else:
if self.sukam <= 6:
rect_1 = (self.x - self.sukam, self.y - self.sukam, self.weight + self.sukam * 2,
self.height + self.sukam * 2)
rect_2 = (self.x, self.y, self.weight, self.height)
ellipse_2 = pg.draw.rect(display, self.color, rect_2)
text_but = Font(self.ms_x, self.ms_y, self.active_color, self.font_size,
message=self.message)
text_but.draw_text()
self.sukam += 4
else:
rect_2 = (self.x, self.y, self.weight, self.height)
rect_1 = (self.x - self.sukam, self.y - self.sukam, self.weight + self.sukam * 2,
self.height + self.sukam * 2)
el = pg.draw.rect(display, self.second_color, rect_1)
ellipse_2 = pg.draw.rect(display, self.color, rect_2)
text_but = Font(self.ms_x, self.ms_y, self.active_color, self.font_size,
message=self.message)
text_but.draw_text()
self.action = False
else:
rect_1 = (self.x, self.y, self.weight, self.height)
ellipse_1 = pg.draw.rect(display, self.color, rect_1)
text_but = Font(self.ms_x, self.ms_y, self.font_color, self.font_size, message=self.message)
text_but.draw_text()
self.action = False
return self.action
def main_menu_rus():
show_menu = True
while show_menu:
event = pg.event.poll()
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
x_main_text = int(__SIZE[0] / 2 - int((170 / 800) * __SIZE[0]))
font = int(__SIZE[1] / (600 / 30))
main_text_1 = Font(x_main_text, int(__SIZE[1] / 24), MAIN_COLOR_FONT, message='Математический', font_size=font)
main_text_2 = Font(int(__SIZE[0] / 2 - int((100 / 800) * __SIZE[0])),
int(__SIZE[1] / 24) + int(__SIZE[1] / (600 / 30)), MAIN_COLOR_FONT, message='треннажер',
font_size=font)
version_text = Font(int(__SIZE[0] - 234), int(__SIZE[1] / 1.03), COLOR_VERSION_SCORE,
message='Бета версия: 0.0.5', \
font_size=20)
button_play = Button(int(__SIZE[0] / 2 - (__SIZE[0] / 8)), int(__SIZE[1] / 6.4), int(__SIZE[0] / 4),
int(__SIZE[1] / 12), COLOR_BUTTON_1, 'Играть',
font_type='/shrift/play_menu.otf', active_color=ACTIVE_COLOR,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (50 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / 6.4 + int(__SIZE[1] / (80 / 1.2))), second_color=COLOR_BUTTON_2)
button_level = Button(int(__SIZE[0] / 2 - (__SIZE[0] / 8)), int(__SIZE[1] / 3.55555556), int(__SIZE[0] / 4),
int(__SIZE[1] / 12),
COLOR_BUTTON_1, 'Уровни', font_size=int(__SIZE[1] / 24),
font_type='/shrift/play_menu.otf', active_color=ACTIVE_COLOR,
actived_color=MAIN_COLOR_FONT,
message_x=int(__SIZE[0] / 2 - (50 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / 3.5555555556 + int(__SIZE[1] / (80 / 1.2))),
second_color=COLOR_BUTTON_2)
button_achivment = Button(int(__SIZE[0] / 2 - (__SIZE[0] / 8)), int(__SIZE[1] / (800 / 325)),
int(__SIZE[0] / 4), int(__SIZE[1] / 12),
COLOR_BUTTON_1, 'Достижения', font_size=int(__SIZE[1] / 32),
font_type='/shrift/play_menu.otf', active_color=ACTIVE_COLOR,
actived_color=MAIN_COLOR_FONT,
message_x=int(__SIZE[0] / 2 - (68 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 325) + int(__SIZE[1] / (80 / 1.2))),
second_color=COLOR_BUTTON_2)
button_anygames = Button(int(__SIZE[0] / 2 - (__SIZE[0] / 8)), int(__SIZE[1] / (800 / 425)), int(__SIZE[0] / 4),
int(__SIZE[1] / 12), COLOR_BUTTON_1,
'Другое', font_size=int(__SIZE[1] / 28),
font_type='/shrift/play_menu.otf', active_color=ACTIVE_COLOR,
actived_color=MAIN_COLOR_FONT,
message_x=int(__SIZE[0] / 2 - (44 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 425) + int(__SIZE[1] / (80 / 1.2))),
second_color=COLOR_BUTTON_2)
button_help = Button(0, 0, int(__SIZE[0] / (800 / 75)), int(__SIZE[1] / (600 / 75)), COLOR_BUTTON_SETUP_1, 'П',
BLACK_COLOR,
font_type='shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=COLOR_BUTTON_2,
message_x=int(__SIZE[0] / (800 / 75) / 2 - int((24 / 800) * __SIZE[0])),
message_y=int(__SIZE[1] / 0.8 / 80), second_color=COLOR_BUTTON_SETUP_2,
font_size=int(__SIZE[1] / 10))
button_setup = Button(int(__SIZE[0] / (800 / 725)), 0, int(__SIZE[0] / (800 / 75)), int(__SIZE[1] / (600 / 75)),
COLOR_BUTTON_SETUP_1,
message='Н', font_color=BLACK_COLOR, font_type='shrift/play_menu.otf',
active_color=MAIN_COLOR_FONT,
actived_color=COLOR_BUTTON_2,
message_x=int(__SIZE[0] - (__SIZE[0] / (800 / 75) / 2) - int((1 / 33) * __SIZE[0])),
message_y=int(__SIZE[1] / 0.8 / 80),
second_color=COLOR_BUTTON_SETUP_2, font_size=int(__SIZE[1] / 10))
button_setup.draw()
button_help.draw()
button_achivment.draw()
button_anygames.draw()
button_level.draw()
draw_triangle([0, __SIZE[1]], [int(__SIZE[0] / (800 / 200)), __SIZE[1]],
[int(__SIZE[0] / (800 / 100)), int(__SIZE[1] / (600 / 400))], 'k', color=FIRST_FIGURE_COLOR)
draw_circle([int(__SIZE[0] / (800 / 100)), int(__SIZE[1] / (600 / 360))], int(__SIZE[0] / (800 / 50)),
THRE_FIGURE_COLOR)
button_play.draw()
version_text.draw_text()
main_text_1.draw_text()
main_text_2.draw_text()
pg.display.update()
if button_play.action:
pg.time.wait(50)
start_play_rus()
elif button_setup.action:
pg.time.wait(50)
setup_menu_start_rus()
elif button_level.action:
pg.time.wait(50)
start_level_rus()
elif button_achivment.action:
pg.time.wait(50)
achivment_rus()
elif button_help.action:
pg.time.wait(50)
help_rus()
elif button_anygames.action:
pg.time.wait(50)
any_game_menu_rus()
if Exit:
show_menu = False
def help_rus():
h = 0
k = 0
ready1 = True
ready2 = True
show_menu_help = True
font_vk = Font(int(__SIZE[0] / (800 / 100)), int(__SIZE[1] / (600 / 225)), COLOR_VERSION_SCORE,
int(__SIZE[1] / (600 / 20)),
message='Нажмите сюда чтобы посетить наш Vk')
font_ds = Font(int(__SIZE[0] / (800 / 100)), int(__SIZE[1] / (600 / 350)), COLOR_VERSION_SCORE,
int(__SIZE[1] / (600 / 20)),
message='Нажмите сюда чтобы посетить наш Discord')
main_text_font = Font(int(__SIZE[0] / (800 / 330)), int(__SIZE[1] / (600 / 20)), MAIN_COLOR_FONT,
int(__SIZE[1] / (600 / 40)),
message='Помощь')
while show_menu_help:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
if event.type == pg.VIDEOEXPOSE:
ready1 = False
ready2 = False
elif event.type != pg.VIDEOEXPOSE:
ready1 = True
ready2 = True
display.fill(COLOR_DISPLAY)
ready1 = draw_vk(int(__SIZE[0] / (800 / 628)), int(__SIZE[1] / (600 / 206)), int(__SIZE[0] / (800 / 50)),
int(__SIZE[0] / (800 / 50)), ready1)
ready2 = draw_dis(int(__SIZE[0] / (800 / 695)), int(__SIZE[1] / (600 / 332)), int(__SIZE[0] / (800 / 50)),
int(__SIZE[0] / (800 / 50)), ready2)
font_ds.draw_text()
font_vk.draw_text()
get_code_rus()
main_text_font.draw_text()
show_menu_help = draw_exit(show_menu_help)
pg.display.update()
pg.time.wait(150)
def achivment_rus():
show_menu_achivment = True
if SCORE >= 0 and SCORE < 500:
rank = pg.image.load('image/iron.png')
rank_name = 'железо'
elif SCORE >= 500 and SCORE < 1000:
rank = pg.image.load('image/bronze.png')
rank_name = 'бронза'
elif SCORE >= 1000 and SCORE < 2000:
rank = pg.image.load('image/silver.png')
rank_name = 'серебро'
elif SCORE >= 2000 and SCORE < 3000:
rank = pg.image.load('image/gold.png')
rank_name = 'золото'
elif SCORE >= 3000 and SCORE < 5000:
rank = pg.image.load('image/platium.png')
rank_name = 'платина'
elif SCORE >= 5000 and SCORE < 10000:
rank = pg.image.load('image/diamond.png')
rank_name = 'алмаз'
elif SCORE >= 10000 and SCORE < 20000:
rank = pg.image.load('image/master.png')
rank_name = 'мастер'
elif SCORE >= 20000 and SCORE < 100000:
rank = pg.image.load('image/gr_master.png')
rank_name = 'гранд-мастер'
elif SCORE >= 100000:
rank = pg.image.load('image/legend.png')
rank_name = 'Легенда'
elif SCORE == 666:
rank = pg.image.load('image/belaz.png')
else:
rank_name = 'новобранец'
text_1 = Font(int(__SIZE[0] / (800 / 280)), int(__SIZE[1] / (600 / 400)), COLOR_VERSION_SCORE,
int(__SIZE[1] / (600 / 34)),
message=f'Ваш ранк - {rank_name}', font_type='shrift/math_prem.otf')
text_2 = Font(int(__SIZE[0] / 2 - __SIZE[0] / (600 / 100)), int(__SIZE[1] / (600 / 440)), COLOR_VERSION_SCORE,
int(__SIZE[1] / (600 / 30)), message=f'Ваши счет - {SCORE}', font_type='shrift/math_prem.otf')
while show_menu_achivment:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
rank_rect = rank.get_rect(center=(int(__SIZE[0] / 2), int(__SIZE[1] / 2 - __SIZE[1] / (600 / 100))))
text_1.draw_text()
text_2.draw_text()
display.blit(rank, rank_rect)
show_menu_achivment = draw_exit(show_menu_achivment)
pg.display.update()
def start_play_rus():
h = 0
button_go = False
global SCORE
draw_ok = False
draw_notok = False
valid = True
show_play = True
need_input = False
input_text = ''
score = SCORE
okey = True
need_generaite = True
button_answer = Button_rect(int(__SIZE[0] / (800 / 250)), int(__SIZE[1] / (800 / 650)),
int(__SIZE[0] / (800 / 300)),
int(__SIZE[1] / (800 / 60)), COLOR_BUTTON_1, 'Ответить', (0, 0, 0),
int(__SIZE[1] / (600 / 30)),
'shrift\math_prem1.ttf', (0, 0, 0), (0, 0, 0), int(__SIZE[0] / (800 / 330)),
int(__SIZE[1] / (800 / 660)), COLOR_BUTTON_2)
examp = Example(__SIZE)
while show_play:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
if need_input and event.type == pg.KEYDOWN:
if event.unicode == '1' or event.unicode == '2' or event.unicode == '3' or event.unicode == '4' or event.unicode == '5' \
or event.unicode == '6' or event.unicode == '7' or event.unicode == '8' or event.unicode == '9' or event.unicode == '0' \
or event.unicode == '.' or event.unicode == '-' or event.unicode == ',':
valid = True
else:
valid = False
if len(input_text) >= 20:
okey = False
if event.key == pg.K_BACKSPACE:
input_text = input_text[0:-1]
okey = True
valid = True
elif okey and valid:
if event.unicode == ',':
event.unicode = '.'
input_text += event.unicode
if event.key == pg.K_RETURN and input_text != '':
valid = True
if examp.bool_pr(input_text):
examp.gen_ex()
input_text = ''
draw_ok = True
draw_time_ok = 1
SCORE += examp.score
score += examp.score
draw_notok = False
else:
draw_notok = True
draw_time_nok = 1
button_go = False
if need_generaite:
examp.gen_ex()
error_1 = Font(int(__SIZE[0] / (800 / 560)), int(__SIZE[1] / (800 / 520)) + int(__SIZE[1] / (800 / 15)),
font_size=int(__SIZE[1] / (600 / 14)), font_color=(255, 0, 0), message='Ошибка: длинный ответ')
error_2 = Font(int(__SIZE[0] / (800 / 560)), int(__SIZE[1] / (800 / 520)) + int(__SIZE[1] / (800 / 15)),
font_size=int(__SIZE[1] / (600 / 14)), font_color=(255, 0, 0),
message='Ошибка: Неверный формат данных')
entry_otvet = Entry_text(ANTI_VERSION_SCORE_COLOR, ACTIVE_COLOR, COLOR_ENTRY_TEXT, input_text,
int(__SIZE[1] / (600 / 24)),
'shrift\\math_prem1.ttf', int(__SIZE[0] / (800 / 250)), int(__SIZE[1] / (800 / 500)),
int(__SIZE[0] / (800 / 300)),
int(__SIZE[1] / (800 / 60)), ACTIVE_COLOR, need_input, int(__SIZE[0] / (800 / 260)),
int(__SIZE[1] / (800 / 500)) + int(__SIZE[1] / (800 / 15)))
if input_text == '':
entry_otvet.text = 'Ответ введите ответ сюда'
display.fill(COLOR_DISPLAY)
examp.draw()
button_answer.draw()
entry_otvet.draw()
show_play = draw_exit(show_play)
score_font = Font(int(__SIZE[0] - (len(str(score)) + 5) * 25), 20, COLOR_VERSION_SCORE,
int(__SIZE[1] / (600 / 28)), message=f'Очки: {score}')
score_font.draw_text()
if not okey:
error_1.draw_text()
if not valid:
error_2.draw_text()
if draw_ok and draw_time_ok <= 1000 and okey and valid:
draw_okay(int(__SIZE[0] / (800 / 600)), int(__SIZE[1] / (800 / 520)) + int(__SIZE[1] / (800 / 15)),
int(__SIZE[0] / (800 / 40)))
draw_time_ok += 1
if draw_notok and draw_time_nok <= 1000 and okey and valid:
draw_no_okay(int(__SIZE[0] / (800 / 600)), int(__SIZE[1] / (800 / 520)) + int(__SIZE[1] / (800 / 15)),
int(__SIZE[0] / (800 / 40)))
draw_time_nok += 1
pg.display.update()
need_input = entry_otvet.need_input
if button_answer.action:
need_input = True
if h == 2:
if input_text != '':
valid = True
if examp.bool_pr(input_text):
examp.gen_ex()
input_text = ''
draw_ok = True
draw_time_ok = 1
SCORE += examp.score
score += examp.score
draw_notok = False
else:
draw_notok = True
draw_time_nok = 1
else:
h += 1
need_generaite = False
pg.time.wait(1)
def setup_menu_start_rus():
global Exit
button_display = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Экран',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (50 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)), second_color=COLOR_BUTTON_2)
button_theme = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Тема',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (40 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
button_lang = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Язык',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (44 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 590)),
second_color=COLOR_BUTTON_2)
main_sett_font = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 120)), int(__SIZE[1] / (800 / 40)),
message='Настройки', font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
show_menu_setup = True
while show_menu_setup:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_setup = draw_exit(show_menu_setup)
button_display.draw()
button_lang.draw()
button_theme.draw()
main_sett_font.draw_text()
pg.display.update()
if button_theme.action:
menu_theme_settings_rus()
elif button_lang.action:
setup_lang_rus()
elif button_display.action:
menu_display_settings_rus()
Exit = True
def setup_lang_rus():
global LANG
show_menu_lang_setup = True
ok_1 = False
ok_2 = False
if LANG == 1:
ok_1 = True
elif LANG == 2:
ok_2 = True
okey_1 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_1, 5)
okey_2 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_2, 5)
button_eng = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Английский',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)),
second_color=COLOR_BUTTON_2)
button_rus = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Русский',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
main_sett_font = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 100)), int(__SIZE[1] / (800 / 40)),
message='Язык',
font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
while show_menu_lang_setup:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_lang_setup = draw_exit(show_menu_lang_setup)
button_eng.draw()
button_rus.draw()
okey_1.draw()
okey_2.draw()
main_sett_font.draw_text()
if okey_1.action:
LANG = 1
okey_2.ok = False
elif okey_2.action:
LANG = 2
okey_1.ok = False
pg.display.update()
okey_1.action = False
okey_2.action = False
def start_level_rus():
global EX_1
button_5_class = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '5 класс',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (60 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)), second_color=COLOR_BUTTON_2)
button_6_class = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '6 класс',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (50 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
button_7_class = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '7 класс',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (50 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 590)),
second_color=COLOR_BUTTON_2)
main_sett_font = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 220)), int(__SIZE[1] / (800 / 40)),
message='Выберите ваш класс',
font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
show_menu_level = True
while show_menu_level:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_level = draw_exit(show_menu_level)
button_5_class.draw()
button_6_class.draw()
main_sett_font.draw_text()
pg.display.update()
if button_5_class.action:
EX_1 = 5
menu_level_class_rus()
elif button_6_class.action:
EX_1 = 6
menu_level_class_rus()
def menu_level_class_rus():
global EX_2
show_menu_setup_five_class = True
ok_1 = False
ok_2 = False
ok_3 = False
if EX_2 == 1:
ok_1 = True
elif EX_2 == 2:
ok_2 = True
elif EX_2 == 3:
ok_3 = True
okey_1 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_1, 5)
okey_2 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_2, 5)
okey_3 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_3, 5)
button_easy = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Легкий',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)),
second_color=COLOR_BUTTON_2)
button_medium = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Средний',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
button_hard = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Сложный',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 590)),
second_color=COLOR_BUTTON_2)
main_sett_font_level = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 200)), int(__SIZE[1] / (800 / 40)),
message='Выберите сложность',
font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
while show_menu_setup_five_class:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_setup_five_class = draw_exit(show_menu_setup_five_class)
main_sett_font_level.draw_text()
button_easy.draw()
okey_1.draw()
button_medium.draw()
okey_2.draw()
button_hard.draw()
okey_3.draw()
pg.display.update()
theme_upload(THEME)
if okey_2.action:
okey_1.ok = False
okey_3.ok = False
EX_2 = 2
elif okey_3.action:
okey_1.ok = False
okey_2.ok = False
EX_2 = 3
elif okey_1.action:
okey_2.ok = False
okey_3.ok = False
EX_2 = 1
okey_1.action = False
okey_2.action = False
okey_3.action = False
def menu_theme_settings_rus():
global THEME
show_menu_setup_theme = True
ok_1 = False
ok_2 = False
ok_3 = False
if THEME == 1:
ok_1 = True
elif THEME == 2:
ok_2 = True
elif THEME == 3:
ok_3 = True
okey_1 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_1, 5)
okey_2 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_2, 5)
okey_3 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_3, 5)
button_standart = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Стандартная',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)),
second_color=COLOR_BUTTON_2)
button_dracula = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Дракула',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
button_white = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Светлая',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 590)),
second_color=COLOR_BUTTON_2)
main_sett_font_theme = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 80)), int(__SIZE[1] / (800 / 40)),
message='Тема',
font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
while show_menu_setup_theme:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_setup_theme = draw_exit(show_menu_setup_theme)
main_sett_font_theme.draw_text()
button_standart.draw()
okey_1.draw()
button_white.draw()
okey_3.draw()
button_dracula.draw()
okey_2.draw()
pg.display.update()
theme_upload(THEME)
if okey_2.action:
okey_1.ok = False
okey_3.ok = False
THEME = 2
elif okey_3.action:
okey_1.ok = False
okey_2.ok = False
THEME = 3
elif okey_1.action:
okey_2.ok = False
okey_3.ok = False
THEME = 1
okey_1.action = False
okey_2.action = False
okey_3.action = False
def menu_display_settings_rus():
global SIZE
show_menu_setup_display = True
ok_1 = False
ok_2 = False
ok_3 = False
if SIZE == 1:
ok_1 = True
elif SIZE == 2:
ok_2 = True
elif SIZE == 3:
ok_3 = True
okey_1 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 175)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_1, 5)
okey_2 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 375)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_2, 5)
okey_3 = Window_ok(int(__SIZE[0] / 2 - (__SIZE[0] / 4)) + int(__SIZE[0] / 2) - int(__SIZE[0] / (800 / 50)),
int(__SIZE[1] / (800 / 575)), int(__SIZE[0] / (800 / 50)), int(__SIZE[1] / (600 / 50)),
ANTI_VERSION_SCORE_COLOR,
ACTIVE_COLOR, COLOR_VERSION_SCORE, ACTIVE_COLOR, COLOR_VERSION_SCORE, ok_3, 5)
button_800_600 = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 175)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '800 X 600',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 190)),
second_color=COLOR_BUTTON_2)
button_1000_800 = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 375)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '1000 X 700',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 390)),
second_color=COLOR_BUTTON_2)
button_1200_900 = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (800 / 575)),
int(__SIZE[0] / 2),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, '1200 X 900',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(__SIZE[0] / 2 - (200 / 800) * __SIZE[0]),
message_y=int(__SIZE[1] / (800 / 590)),
second_color=COLOR_BUTTON_2)
main_sett_font_display = Font(int(__SIZE[0] / 2 - __SIZE[0] / (800 / 100)), int(__SIZE[1] / (800 / 40)),
message='Экран',
font_size=int(__SIZE[1] / (800 / 50)), font_color=MAIN_COLOR_FONT)
while show_menu_setup_display:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
main_sett_font_display.draw_text()
show_menu_setup_display = draw_exit(show_menu_setup_display)
button_800_600.draw()
okey_1.draw()
button_1000_800.draw()
okey_2.draw()
button_1200_900.draw()
okey_3.draw()
if okey_2.action:
okey_1.ok = False
okey_3.ok = False
SIZE = 2
elif okey_3.action:
okey_1.ok = False
okey_2.ok = False
SIZE = 3
elif okey_1.action:
okey_2.ok = False
okey_3.ok = False
SIZE = 1
okey_1.action = False
okey_2.action = False
okey_3.action = False
pg.display.update()
def any_game_menu_rus():
show_menu_any_game = True
text = Font(int(__SIZE[0] / (800 / 315)), int(__SIZE[1] / (600 / 40)), MAIN_COLOR_FONT, int(__SIZE[1] / (600 / 40)),
message='Другое')
yes_or_no = Button_rect(int(__SIZE[0] / 2 - (__SIZE[0] / 4)), int(__SIZE[1] / (600 / 300)),
int(__SIZE[0] / (800 / 400)),
int(__SIZE[1] / 12), COLOR_SETUP_MENU_1, 'Правда ложь',
font_type='/shrift/play_menu.otf', active_color=MAIN_COLOR_FONT,
actived_color=MAIN_COLOR_FONT,
font_size=int(__SIZE[1] / 24),
message_x=int(int(__SIZE[0] / 2 - (__SIZE[0] / 4) + (__SIZE[0] / (800 / 95)))),
message_y=int(__SIZE[1] / (600 / 315)),
second_color=COLOR_BUTTON_2)
while show_menu_any_game:
for event in pg.event.get():
if event.type == pg.QUIT:
output_settings()
display.fill(COLOR_DISPLAY)
show_menu_any_game = draw_exit(show_menu_any_game)
text.draw_text()
yes_or_no.draw()
if yes_or_no.action:
pg.time.wait(50)
yes_or_no_rus()
pg.display.update()
def yes_or_no_rus():
s = 40
d = 60
color_list = [0, 0, 200]
color_list_2 = [0, 0, 100]
color_list_3 = [0, 0, 100]
flag = 1
show_menu_y_r = True
h = 0
play_button = New_button(int(__SIZE[0] / (800 / 250)), int(__SIZE[1] / (600 / 300)), int(__SIZE[0] / (800 / 300)),
int(__SIZE[1] / (600 / 80)), 'Играть', (0, 0, 0), int(__SIZE[1] / (600 / 36)),
active_color=ACTIVE_COLOR,
message_x=int(__SIZE[0] / (800 / 320)), message_y=int(__SIZE[1] / (600 / 320)),
sukam=int(__SIZE[0] / (800 / 10)))
rule_button = New_button(int(__SIZE[0] / (800 / 250)), int(__SIZE[1] / (600 / 450)), int(__SIZE[0] / (800 / 300)),
int(__SIZE[1] / (600 / 80)), 'Правила', (0, 0, 0), int(__SIZE[1] / (600 / 36)),
active_color=ACTIVE_COLOR,
message_x=int(__SIZE[0] / (800 / 347)),
message_y=int(__SIZE[1] / (600 / 470)), sukam=int(__SIZE[0] / (800 / 10)))
main_text = Font(int(__SIZE[0] / (800 / 213)), int(__SIZE[1] / (600 / 100)), font_size=int(__SIZE[1] / (600 / 46)),
message='Правда ложь')
while show_menu_y_r:
for event in pg.event.get():