-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
45 lines (38 loc) · 1.29 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
import BaseBuilding
import looting
import inventory
import pickle
# save game
class GameSave():
@staticmethod
def save_game(self):
with open("savefile_1.txt", "wb") as f:
pickle.dump([player, level_state], f, protocol=2)
@staticmethod
def load_game(self):
with open("savefile_1.txt", "wb") as f:
player, level_state = pickle.load(f)
print('Pick a save game:')
print('[savefile_1]')
save_file = input().lower() + ".txt"
if save_file == "savefile_1.txt":
GameSave.load_game()
# Introduction sequence
print("What would you like to do?")
print("[Base building, Scouting, Supply run, Inventory, Quit]")
menu_input = input().lower()
print("")
while menu_input != 'quit':
if menu_input == 'b' or menu_input == 'base' or menu_input == 'base building' or menu_input == 'building':
BaseBuilding.main()
elif menu_input == 'scouting' or menu_input == 'scout':
looting.scout()
elif menu_input == 'supply' or menu_input == 'run' or menu_input == 'supply run':
looting.supply()
elif menu_input == 'inv' or menu_input == 'inventory':
inventory.main()
print("What would you like to do?")
print("[Base building, Scouting, Supply run, Quit]")
menu_input = input().lower()
print("")
print('Out of menu.')