-
Notifications
You must be signed in to change notification settings - Fork 0
/
menu.py
126 lines (95 loc) · 3.02 KB
/
menu.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
import asciiart
import os
import time
import ui
import helpers
import engine
import main
import const
import shutil
from termcolor import colored
from art import *
def print_menu():
helpers.clear_screen()
empty_space = 7 * "\n"
print(empty_space)
#print(colored(const.LOGO[1], 'yellow', attrs=[]))
ui.show_logo_animation(asciiart.LOGO, True)
print(empty_space)
print(colored("PRESS ANY KEY TO START", "white", attrs=['bold', 'blink']).center(shutil.get_terminal_size().columns))
helpers.key_pressed()
ui.show_logo_animation(asciiart.LOGO, False)
show_animation(asciiart.swing, asciiart.orphan)
# elif user_input == "2":
# # engine.customize_character(player)
# elif user_input == "0":
# # sys.exit(0)
#else:
# raise KeyError("There is no such option.")
def show_intro(list_with_picture):
os.system('clear')
t = 0.5
empty_space = 5 * "\n"
for picture in list_with_picture:
print(empty_space)
for pictureLine in picture.splitlines():
print(pictureLine.center(shutil.get_terminal_size().columns))
time.sleep(t)
os.system('clear')
def show_animation(swing, orphan):
t = 3
empty_space = 10 * "\n"
for i in range(3):
show_intro(swing)
os.system('clear')
ui.show_story()
os.system('clear')
for picture in orphan:
os.system('clear')
print(empty_space)
for pictureLine in picture.splitlines():
print(pictureLine.center(shutil.get_terminal_size().columns))
time.sleep(t)
main.init()
def win():
t =2
empty_space = 5 * "\n"
os.system("clear")
for picture in lynx:
print(empty_space)
for pictureLine in picture.splitlines():
print(pictureLine.center(shutil.get_terminal_size().columns))
time.sleep(2)
os.system('clear')
print(empty_space)
for pictureLine in asciiart.heart_lynx.splitlines():
print(pictureLine.center(shutil.get_terminal_size().columns))
play_again()
def play_again():
play_again = input("Do you want to play again(yes/no)? ")
if play_again == "yes":
print_menu()
else:
raise SystemExit
# def show_intro(picture):
# board = engine.create_board(80,30)
# BOARD_HEIGHT = len(board)
# BOARD_WIDTH = len(board[0])
# WALL = '█'
# for i in range(BOARD_HEIGHT):
# for e in range(BOARD_WIDTH):
# if i == 0 or e == 0 or i == BOARD_HEIGHT-1 or e == BOARD_WIDTH-1:
# board[i][e] = WALL
# helpers.clear_screen()
# #picture = asciiart.picture
# lineList = picture.splitlines()
# artWidth = len(lineList[1])
# artHeight = len(lineList)
# widthShift = int((BOARD_WIDTH - artWidth)/2)
# heighthShift = int((BOARD_HEIGHT - artHeight)/2)
# for i in range(len(lineList)):
# lineLen = len(lineList[i])
# for j in range(lineLen):
# board[i+heighthShift][j+widthShift] = lineList[i][j]
print_menu()
# print_menu()