-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmain.py
More file actions
56 lines (39 loc) · 1.3 KB
/
main.py
File metadata and controls
56 lines (39 loc) · 1.3 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
import Character as c
import Battle as b
import save
file = save.SaveLoader()
def Start():
while True:
new=input("1) New game: \n2) Load Game\n3) Show all saves\n").strip()
if new=='1' or new == '2':
name=input("Enter your name: ").strip().lower().replace(" ","")
if name and not name.isspace():
if new=='1':
Save(name,0)
break
elif new=='2':
is_load=Load(name)
if is_load[0]==True:
print(f"Name: {name}, Level: {is_load[1]['lvl']}")
else:
print(f"Name '{name}' not found in the file.")
break
else:
print("\a!!name must not be empty or contain space!!")
elif new=='3':
All_saves()
else:
pass
#enemy1= c.Enemy("Goblin", hp=15, atk=2, defense=1, reward_gold=5, reward_items=["Rusty Dagger"])
def Fight():
battle = b.battle(player1,enemy1)
battle.start()
def Load(name):
return file.load(name)
def All_saves():
return file.show_all_save()
def Save(name,current_level):
return file.save(name,current_level)
name = Start()
#player = c.Player(name)
#print(player)