-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathstartmenu.py
58 lines (51 loc) · 1.66 KB
/
startmenu.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
import msvcrt
import os
import AsciiImgs
import battlesystem
from time import sleep
red = '\033[91m'
setar_cor = '\033[97m'
selection = 0
def clear():
os.system('cls')
def MainMenu():
clear()
print(red)
AsciiImgs.printUTF8(AsciiImgs.menuImg)
print(setar_cor)
print('Use as teclas A e D', '\n', 'E ENTER para selecionar')
print('\n' * 1)
print(' '*15, red, '-(> INICIAR', setar_cor)
print(' '*15, 'SAIR')
selection = 0
while True:
if msvcrt.kbhit():
tecla = msvcrt.getch()
if tecla == b'A' or tecla == b'a':
clear()
selection = 0
print(red)
AsciiImgs.printUTF8(AsciiImgs.menuImg)
print(setar_cor)
print('Use the keys A and D to navigate','\n','Press ENTER to select\n')
print(' '*4, red, '-(> INICIAR', setar_cor)
print(' '*4, 'SAIR')
elif tecla == b'd' or tecla == b'D':
clear()
selection = 1
print(red)
AsciiImgs.printUTF8(AsciiImgs.menuImg)
print(setar_cor)
print('Use the keys A and D to navigate','\n','Press ENTER to select\n')
print(' '*4, 'INICIAR')
print(' '*4, red,'-(> SAIR', setar_cor)
if tecla == b'\r' and selection == 0:
print('Starting the game')
sleep(1)
battlesystem.StartBattle()
break
elif tecla == b'\r' and selection == 1:
print('Closing terminal')
break
battlesystem.BattleOn = True
MainMenu()