-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmenu_modules.py
More file actions
61 lines (58 loc) · 1.89 KB
/
Copy pathmenu_modules.py
File metadata and controls
61 lines (58 loc) · 1.89 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
import pybuzzers
import time
import os
import sys
import controller_management, leaderboard
import questionManagement
buzzer = pybuzzers.get_all_buzzers()[0]
def loadingLights(buzzer):
for count in range(1):
for i in range(4):
buzzer.set_light(i, True)
time.sleep(0.5)
for i in range(4):
buzzer.set_light(i, False)
time.sleep(0.5)
def mainMenu():
try:
buzzer.stop_listening()
except Exception:
pass
os.system('cls')
print('Project Cortex\n\n\n\n')
print(' 1) Start Game 2) Download Questions 3) Leaderboard 4) Exit')
menuInput = input('>> ')
if menuInput == ('1'):
os.system('cls')
print('Select Game Mode\n\n\n\n')
print(' 1) Hosted Quiz 2) Multiquestion')
gameSelect = input('>> ')
if gameSelect == ('1'):
os.system('cls')
print('Game Start')
buzzer.on_buzz(controller_management.buzzIn)
buzzer.start_listening()
while not controller_management.end_game_requested:
time.sleep(0.1)
controller_management.end_game_requested = False
mainMenu()
return
elif gameSelect == ('2'):
## COME BACK TO THIS ONCE QUESTIONS HAVE BEEN IMPLIMENTED
os.system('cls')
print('Multiquestion Mode')
questionManagement.reset_question_pool()
controller_management.show_random_question()
buzzer.on_button_down(controller_management.multiBuzz)
time.sleep(1)
mainMenu()
elif menuInput == ('2'):
os.system('cls')
print('Contacting the TeamOrbi servers...')
time.sleep(1)
mainMenu()
elif menuInput == ('3'):
leaderboard.leaderboard_menu()
mainMenu()
elif menuInput == ('4'):
sys.exit(0)