-
Notifications
You must be signed in to change notification settings - Fork 5
/
Copy pathmain.py
567 lines (432 loc) · 24 KB
/
main.py
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
from tkinter import *
from tkinter import messagebox
from PIL import Image, ImageDraw, ImageFont, ImageTk
from reasoning import Reasoning
from perceptual_speed import PerceptualSpeed
from number_speed import NumberSpeedAccuracy
from word_meaning import WordMeaning
from spatial_visualisation import SpatialVisualisation
import numpy as np
import PIL
import random
# ---------------------------- COLORS ------------------------------- #
CHAMPAGNE_PINK = "#F2DFD7"
GHOST_WHITE = "#FEF9FF"
THISTLE = "#D4C1EC"
MAXIMUM_BLUE_PURPLE = "#9F9FED"
MEDIUM_SLATE_BLUE = "#736CED"
# ---------------------------- CONSTANTS ------------------------------- #
FONT_NAME = "Georgia"
TIMER = None
timer_label = None
GAME_WINDOW = None
exercise = 0
image_pairs = None
buttons = []
# ---------------------------- GAME INFO ------------------------------- #
def show_score():
if exercise == 1:
message = f""" Your final score is: {reasoning.score} / {reasoning.questions}.
Do you want to download a report for the ‘REASONING’ test?
"""
elif exercise == 2:
message = f""" Your final score is: {perceptual_speed.score} / {perceptual_speed.questions - 1}.
Do you want to download a report for the ‘PERCEPTUAL SPEED’ test?
"""
elif exercise == 3:
message = f""" Your final score is: {number_speed.score} / {number_speed.questions - 1}.
Do you want to download a report for the ‘NUMBER, SPEED & ACCURACY’ test?
"""
elif exercise == 4:
message = f""" Your final score is: {word_meaning.score} / {word_meaning.questions - 1}.
Do you want to download a report for the ‘WORD MEANING’ test?
"""
else:
message = f""" Your final score is: {spatial_visualisation.score} / {spatial_visualisation.questions - 1}.
Do you want to download a report for the ‘SPATIAL VISUALISATION’ test?
"""
buttons_enable(buttons)
GAME_WINDOW.destroy()
if messagebox.askyesno(title="End of the test", message=message):
if exercise == 1:
reasoning.save_report()
elif exercise == 2:
perceptual_speed.save_report()
elif exercise == 3:
number_speed.save_report()
elif exercise == 4:
word_meaning.save_report()
else:
spatial_visualisation.save_report()
else:
pass
# ---------------------------- TIMER ------------------------------- #
def countdown_timer(count):
global TIMER
minutes = str(count // 60).rjust(2, '0')
seconds = str(count % 60).rjust(2, '0')
timer_label.config(text=f"TIME: {minutes}:{seconds}")
if count > 0:
TIMER = GAME_WINDOW.after(1000, countdown_timer, count - 1)
else:
show_score()
# ---------------------------- BUTTONS ------------------------------- #
def buttons_disable(menu_buttons):
for button in menu_buttons:
button.config(state=DISABLED)
def buttons_enable(menu_buttons):
for button in menu_buttons:
button.config(state=NORMAL)
GAME_WINDOW.destroy()
# ---------------------------- REASONING ------------------------------- #
reasoning = Reasoning()
def check_option_r(question_label: Label, option_1: Button, option_2: Button, user_choice):
""" Check if the user has selected the correct answer."""
question_label.destroy()
option_1.destroy()
option_2.destroy()
if reasoning.check_answer(user_choice):
reasoning.score += 1
# print(reasoning.score)
show_phase()
def show_question(phrase_label: Label, question_button: Button):
reasoning.get_question()
reasoning.find_answer()
phrase_label.destroy()
question_button.destroy()
question_label = Label(GAME_WINDOW, text=reasoning.question, bg=GHOST_WHITE)
question_label.config(fg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 20, "bold"), pady=20, padx=100)
question_label.grid(row=1, column=0, columnspan=2)
option_1 = Button(GAME_WINDOW, text=reasoning.person_1, highlightthickness=0)
option_1.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_r(question_label, option_1, option_2, reasoning.person_1))
option_1.grid(row=2, column=0, pady=10, padx=50, sticky="ew")
option_2 = Button(GAME_WINDOW, text=reasoning.person_2, highlightthickness=0)
option_2.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_r(question_label, option_1, option_2, reasoning.person_2))
option_2.grid(row=2, column=1, pady=10, padx=50, sticky="ew")
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def show_phase():
reasoning.get_phrase()
phrase_label = Label(GAME_WINDOW, text=reasoning.phrase, bg=GHOST_WHITE)
phrase_label.config(fg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 20, "bold"), pady=20, padx=60)
phrase_label.grid(row=1, column=0, columnspan=2)
question_button = Button(GAME_WINDOW, text="CLICK THE SCREEN WHEN READY", highlightthickness=0)
question_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: show_question(phrase_label, question_button))
question_button.grid(row=2, column=0, columnspan=2, pady=20, padx=60, sticky="ew")
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def reasoning_game():
global GAME_WINDOW, timer_label, exercise
exercise = 1
reasoning.score = 0
reasoning.questions = 0
info_message = """ Each question is about comparing two people.
You can study this statement for as long as you need to understand it fully.
When you are ready you must click the mouse. When you have done this the statement will disappear and a question about the statement will be shown together with two possible answers.
You must now move the mouse pointer to the box which contains the correct answer. When you have done this, the next question will appear and so on until the end of the test.
The REASONING test runs for about 3 minutes. """
messagebox.showinfo(title="The ‘REASONING’ test", message=info_message)
buttons_disable(buttons)
GAME_WINDOW = Toplevel(main_menu)
GAME_WINDOW.title("Reasoning")
GAME_WINDOW.config(padx=50, pady=40, bg=GHOST_WHITE)
GAME_WINDOW.wm_iconphoto(True, icon)
timer_label = Label(GAME_WINDOW, text="TIME: 00:00", bg=GHOST_WHITE)
timer_label.config(fg=THISTLE, font=(FONT_NAME, 10, "bold"), anchor="ne")
timer_label.grid(row=0, column=1)
show_phase()
countdown_timer(3 * 60)
# ---------------------------- PERCEPTUAL SPEED ------------------------------- #
perceptual_speed = PerceptualSpeed()
def check_option_ps(letters_label: Label, user_choice):
""" Check if the user has selected the correct answer."""
if perceptual_speed.check_answer(user_choice):
perceptual_speed.score += 1
# print(perceptual_speed.score)
show_letters(letters_label)
def show_letters(letters_label: Label):
perceptual_speed.get_letters()
perceptual_speed.find_answer()
letters = f"{perceptual_speed.upper_row[0]} {perceptual_speed.upper_row[1]} {perceptual_speed.upper_row[2]}" \
f" {perceptual_speed.upper_row[3]}\n{perceptual_speed.lower_row[0]} {perceptual_speed.lower_row[1]}" \
f" {perceptual_speed.lower_row[2]} {perceptual_speed.lower_row[3]}"
letters_label.config(text=letters)
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def perceptual_speed_game():
global GAME_WINDOW, timer_label, exercise
exercise = 2
perceptual_speed.score = 0
perceptual_speed.questions = 0
info_message = """ In this test, you will see four pairs of letters. Each pair has been put into its own box.
You must decide how many pairs contain letters that are the same.
The PERCEPTUAL SPEED test runs for about 4 minutes. """
messagebox.showinfo(title="The ‘PERCEPTUAL SPEED’ test", message=info_message)
buttons_disable(buttons)
GAME_WINDOW = Toplevel(main_menu)
GAME_WINDOW.title("Perceptual Speed")
GAME_WINDOW.config(padx=40, pady=20, bg=GHOST_WHITE)
GAME_WINDOW.wm_iconphoto(True, icon)
letters_label = Label(GAME_WINDOW, text="", bg=GHOST_WHITE)
letters_label.config(fg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 40, "bold"), pady=20, padx=100)
letters_label.grid(row=1, column=0, columnspan=5)
option_0 = Button(GAME_WINDOW, text="0", highlightthickness=0)
option_0.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_ps(letters_label, 0))
option_0.grid(row=2, column=0, pady=20, padx=10, sticky="ew")
option_1 = Button(GAME_WINDOW, text="1", highlightthickness=0)
option_1.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_ps(letters_label, 1))
option_1.grid(row=2, column=1, pady=20, padx=10, sticky="ew")
option_2 = Button(GAME_WINDOW, text="2", highlightthickness=0)
option_2.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_ps(letters_label, 2))
option_2.grid(row=2, column=2, pady=20, padx=10, sticky="ew")
option_3 = Button(GAME_WINDOW, text="3", highlightthickness=0)
option_3.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_ps(letters_label, 3))
option_3.grid(row=2, column=3, pady=20, padx=10, sticky="ew")
option_4 = Button(GAME_WINDOW, text="4", highlightthickness=0)
option_4.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 16, "bold"), relief=GROOVE,
command=lambda: check_option_ps(letters_label, 4))
option_4.grid(row=2, column=4, pady=20, padx=10, sticky="ew")
timer_label = Label(GAME_WINDOW, text="TIME: 00:00", bg=GHOST_WHITE)
timer_label.config(fg=THISTLE, font=(FONT_NAME, 10, "bold"), anchor="ne")
timer_label.grid(row=0, column=5)
show_letters(letters_label)
countdown_timer(4 * 60)
# ---------------------------- NUMBER SPEED & ACCURACY ------------------------------- #
number_speed = NumberSpeedAccuracy()
def check_option_nsp(option_0: Button, option_1: Button, option_2: Button, user_choice):
""" Check if the user has selected the correct answer."""
if number_speed.check_answer(user_choice):
number_speed.score += 1
# print(number_speed.score)
show_numbers(option_0, option_1, option_2)
def show_numbers(option_0: Button, option_1: Button, option_2: Button):
number_speed.get_numbers()
number_speed.find_answer()
option_0.config(text=f"{number_speed.numbers[0]}")
option_1.config(text=f"{number_speed.numbers[1]}")
option_2.config(text=f"{number_speed.numbers[2]}")
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def number_speed_game():
global GAME_WINDOW, timer_label, exercise
exercise = 3
number_speed.score = 0
number_speed.questions = 0
info_message = """ For each problem presented, start by finding the largest and the smallest of the three numbers displayed.
Having identified those, decide whether the largest or the smallest is further away from the remaining number.
The NUMBER SPEED & ACCURACY test runs for about 3 minutes. """
messagebox.showinfo(title="The ‘NUMBER, SPEED & ACCURACY’ test", message=info_message)
buttons_disable(buttons)
GAME_WINDOW = Toplevel(main_menu)
GAME_WINDOW.title("Number Speed & Accuracy")
GAME_WINDOW.config(padx=25, pady=20, bg=GHOST_WHITE)
GAME_WINDOW.wm_iconphoto(True, icon)
option_0 = Button(GAME_WINDOW, highlightthickness=0)
option_0.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_nsp(option_0, option_1, option_2, number_speed.numbers[0]))
option_0.grid(row=1, column=0, pady=20, padx=20, sticky="ew")
option_1 = Button(GAME_WINDOW, highlightthickness=0)
option_1.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_nsp(option_0, option_1, option_2, number_speed.numbers[1]))
option_1.grid(row=1, column=1, pady=20, padx=20, sticky="ew")
option_2 = Button(GAME_WINDOW, highlightthickness=0)
option_2.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_nsp(option_0, option_1, option_2, number_speed.numbers[2]))
option_2.grid(row=1, column=2, pady=20, padx=20, sticky="ew")
timer_label = Label(GAME_WINDOW, text="TIME: 00:00", bg=GHOST_WHITE)
timer_label.config(fg=THISTLE, font=(FONT_NAME, 10, "bold"), anchor="ne")
timer_label.grid(row=0, column=3)
show_numbers(option_0, option_1, option_2)
countdown_timer(3 * 60)
# ---------------------------- WORD MEANING ------------------------------- #
word_meaning = WordMeaning()
def check_option_wm(option_0: Button, option_1: Button, option_2: Button, user_choice):
""" Check if the user has selected the correct answer."""
if word_meaning.check_answer(user_choice):
word_meaning.score += 1
# print(word_meaning.score)
show_words(option_0, option_1, option_2)
def show_words(option_0: Button, option_1: Button, option_2: Button):
word_meaning.get_words()
option_0.config(text=f"{word_meaning.pair[0]}")
option_1.config(text=f"{word_meaning.pair[1]}")
option_2.config(text=f"{word_meaning.pair[2]}")
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def word_meaning_game():
global GAME_WINDOW, timer_label, exercise
exercise = 4
word_meaning.score = 0
word_meaning.questions = 0
info_message = """ This is a test to see how quickly you can spot the odd word out in a group.
You will be given three words. Two of the three will be related in some way, and the third is the odd one out. Each time, decide which is the odd one out and select it.
The WORD MEANING test runs for about 2 minutes. """
messagebox.showinfo(title="The ‘WORD MEANING’ test", message=info_message)
buttons_disable(buttons)
GAME_WINDOW = Toplevel(main_menu)
GAME_WINDOW.title("Word Meaning")
GAME_WINDOW.config(padx=25, pady=20, bg=GHOST_WHITE)
GAME_WINDOW.wm_iconphoto(True, icon)
option_0 = Button(GAME_WINDOW, highlightthickness=0)
option_0.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_wm(option_0, option_1, option_2, word_meaning.pair[0]))
option_0.grid(row=1, column=0, pady=20, padx=20, sticky="ew")
option_1 = Button(GAME_WINDOW, highlightthickness=0)
option_1.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_wm(option_0, option_1, option_2, word_meaning.pair[1]))
option_1.grid(row=1, column=1, pady=20, padx=20, sticky="ew")
option_2 = Button(GAME_WINDOW, highlightthickness=0)
option_2.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_wm(option_0, option_1, option_2, word_meaning.pair[2]))
option_2.grid(row=1, column=2, pady=20, padx=20, sticky="ew")
timer_label = Label(GAME_WINDOW, text="TIME: 00:00", bg=GHOST_WHITE)
timer_label.config(fg=THISTLE, font=(FONT_NAME, 10, "bold"), anchor="ne")
timer_label.grid(row=0, column=3)
show_words(option_0, option_1, option_2)
countdown_timer(2 * 60)
# ---------------------------- SPATIAL VISUALISATION ------------------------------- #
spatial_visualisation = SpatialVisualisation()
def check_option_sv(pairs: list[Label], user_choice):
""" Check if the user has selected the correct answer."""
global image_pairs
if spatial_visualisation.check_answer(user_choice):
spatial_visualisation.score += 1
# print(spatial_visualisation.score)
spatial_visualisation.add_report(image_pairs)
show_images(pairs)
def choose_character():
return random.choice('RNSFPG')
def draw_image(side, angle):
"""Generates a PIL Image of a drawn R with a given side and angle"""
global character
letter_font = ImageFont.truetype('verdana.ttf', 80)
# Create a new PIL image
image = Image.new(mode="RGB", size=(100, 100), color="white")
# Draw a black R on the image
draw = ImageDraw.Draw(image)
draw.text((20, 1), character, font=letter_font, fill='black', align='center', stroke_width=1,
stroke_fill='black')
# Rotate the image
image = image.rotate(angle)
# Flip the image horizontally if needed
if side == 1:
image = image.transpose(method=Image.FLIP_LEFT_RIGHT)
return image
def get_pairs_image(images: list):
""" Function which generates a picture of both pairs. """
global image_pairs
pairs_image_rows = []
for index in range(2):
pairs_image_row = np.hstack([images[index], images[index + 2]])
pairs_image_rows.append(pairs_image_row)
image_pairs = np.vstack([i for i in pairs_image_rows])
image_pairs = PIL.Image.fromarray(image_pairs)
image_pairs = image_pairs.resize((75, 75), resample=0)
# image_pairs.show()
def show_images(pairs: list[Label]):
global character
character = choose_character()
spatial_visualisation.get_pairs()
images = []
for pair in spatial_visualisation.pairs:
for letter in pair:
image = draw_image(letter[0], letter[1])
images.append(image)
# Create an image with both pairs together
get_pairs_image(images)
for index in range(4):
images[index] = ImageTk.PhotoImage(images[index])
pairs[index].image = images[index]
pairs[index].config(image=images[index])
GAME_WINDOW.protocol("WM_DELETE_WINDOW", lambda: buttons_enable(menu_buttons=buttons))
def spatial_visualisation_game():
global GAME_WINDOW, timer_label, exercise
exercise = 5
spatial_visualisation.score = 0
spatial_visualisation.questions = 0
pairs = []
info_message = """ This test is designed to see how quickly you can turn shapes around in your head.
The challenge is to see how many boxes contain two shapes that are the same.
The SPATIAL VISUALISATION test runs for about 3 minutes. """
messagebox.showinfo(title="The ‘SPATIAL VISUALISATION’ test", message=info_message)
buttons_disable(buttons)
GAME_WINDOW = Toplevel(main_menu)
GAME_WINDOW.title("Spatial Visualisation")
GAME_WINDOW.config(padx=50, pady=20, bg=GHOST_WHITE)
GAME_WINDOW.wm_iconphoto(True, icon)
pair_1_1 = Label(GAME_WINDOW)
pair_1_1.grid(row=1, column=1)
pairs.append(pair_1_1)
pair_1_2 = Label(GAME_WINDOW)
pair_1_2.grid(row=2, column=1)
pairs.append(pair_1_2)
pair_2_1 = Label(GAME_WINDOW)
pair_2_1.grid(row=1, column=3)
pairs.append(pair_2_1)
pair_2_2 = Label(GAME_WINDOW)
pair_2_2.grid(row=2, column=3)
pairs.append(pair_2_2)
option_0 = Button(GAME_WINDOW, text="0", highlightthickness=0, width=3)
option_0.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_sv(pairs=pairs, user_choice=0))
option_0.grid(row=3, column=0, pady=25, padx=10, sticky="ew")
option_1 = Button(GAME_WINDOW, text="1", highlightthickness=0, width=3)
option_1.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_sv(pairs, user_choice=1))
option_1.grid(row=3, column=2, pady=25, padx=10, sticky="ew")
option_2 = Button(GAME_WINDOW, text="2", highlightthickness=0, width=3)
option_2.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 22, "bold"), relief=GROOVE,
command=lambda: check_option_sv(pairs, user_choice=2))
option_2.grid(row=3, column=4, pady=25, sticky="ew")
timer_label = Label(GAME_WINDOW, text="TIME: 00:00", bg=GHOST_WHITE)
timer_label.config(fg=THISTLE, font=(FONT_NAME, 10, "bold"), anchor="ne")
timer_label.grid(row=0, column=5)
show_images(pairs)
countdown_timer(3 * 60)
# ---------------------------- MAIN MENU ------------------------------- #
main_menu = Tk()
main_menu.title("GIA Practice Tests")
icon = Image.open("resources/my_icon.ico")
icon = ImageTk.PhotoImage(icon)
main_menu.wm_iconphoto(True, icon)
main_menu.config(padx=75, pady=40, bg=GHOST_WHITE)
header_label = Label(text="THOMAS INTERNATIONAL", bg=GHOST_WHITE)
header_label.config(fg=MAXIMUM_BLUE_PURPLE, font=(FONT_NAME, 15, "bold"), pady=10)
header_label.grid(row=0, column=0, columnspan=5)
title_label = Label(text="GIA PRACTICE TESTS*", bg=GHOST_WHITE)
title_label.config(fg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 25, "bold"))
title_label.grid(row=1, column=0, columnspan=5)
disclaimer_label = Label(text="*(Non-official)", bg=GHOST_WHITE)
disclaimer_label.config(fg=MEDIUM_SLATE_BLUE, font=(FONT_NAME, 10, "italic"))
disclaimer_label.grid(row=2, column=3, columnspan=2, pady=10)
reasoning_game_button = Button(text="REASONING", highlightthickness=0)
reasoning_game_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, relief=GROOVE,
font=(FONT_NAME, 15, "bold"), command=reasoning_game)
reasoning_game_button.grid(row=3, column=0, columnspan=5, pady=20, padx=50, sticky="ew")
buttons.append(reasoning_game_button)
perceptual_speed_game_button = Button(text="PERCEPTUAL SPEED", highlightthickness=0)
perceptual_speed_game_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, relief=GROOVE,
font=(FONT_NAME, 15, "bold"), command=perceptual_speed_game)
perceptual_speed_game_button.grid(row=4, column=0, columnspan=5, pady=10, padx=50, sticky="ew")
buttons.append(perceptual_speed_game_button)
number_speed_game_button = Button(text="NUMBER SPEED & ACCURACY", highlightthickness=0)
number_speed_game_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, relief=GROOVE,
font=(FONT_NAME, 15, "bold"), command=number_speed_game)
number_speed_game_button.grid(row=5, column=0, columnspan=5, pady=20, padx=50, sticky="ew")
buttons.append(number_speed_game_button)
word_meaning_game_button = Button(text="WORD MEANING", highlightthickness=0)
word_meaning_game_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, relief=GROOVE,
font=(FONT_NAME, 15, "bold"), command=word_meaning_game)
word_meaning_game_button.grid(row=6, column=0, columnspan=5, pady=20, padx=50, sticky="ew")
buttons.append(word_meaning_game_button)
spatial_visualisation_game_button = Button(text="SPATIAL VISUALISATION", highlightthickness=0)
spatial_visualisation_game_button.config(fg=CHAMPAGNE_PINK, bg=MEDIUM_SLATE_BLUE, relief=GROOVE,
font=(FONT_NAME, 15, "bold"), command=spatial_visualisation_game)
spatial_visualisation_game_button.grid(row=7, column=0, columnspan=5, pady=10, padx=50, sticky="ew")
buttons.append(spatial_visualisation_game_button)
my_logo = PhotoImage(file="resources/my_logo.png")
my_logo_label = Label(main_menu, image=my_logo, bg=GHOST_WHITE)
my_logo_label.grid(row=8, column=1, columnspan=3, sticky="ew")
main_menu.mainloop()