-
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmenu.py
106 lines (76 loc) · 1.8 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
w = "\n We will not survive this!"
x = "\n Size does not matter!"
y = "\n I have no fear!"
z = "\n Don't pick the dwarf!"
class Player:
def __init__(self):
self.type = ""
self.name = ""
self.health = 0
self.attack = 0
self.defense = 0
self.magic = ""
def print(self):
print("\n Type:", self.type)
print(" Name:", self.name)
print(" Health:", self.health)
print(" Attack:", self.attack)
print(" Defense:", self.defense)
print(" Magic:", self.magic)
warrior = Player()
warrior.type = "Warrior"
warrior.name = "Hugo"
warrior.health = 100
warrior.attack = 150
warrior.defense = 50
warrior.magic = "Fire"
dwarf = Player()
dwarf.type = "Dwarf"
dwarf.name = "Roald"
dwarf.health = 100
dwarf.attack = 50
dwarf.defense = 150
dwarf.magic = "Earth"
rogue = Player()
rogue.type = "Rogue"
rogue.name = "Donovan"
rogue.health = 150
rogue.attack = 75
rogue.defense = 75
rogue.magic = "Water"
elf = Player()
elf.type = "Elf"
elf.name = "Helmer"
elf.health = 200
elf.attack = 50
elf.defense = 50
elf.magic = "Air"
def start():
print("\n Please select a character. (1, 2, 3 or 4)")
print(" 1. Warrior")
print(" 2. Dwarf")
print(" 3. Rogue")
print(" 4. Elf")
print("\n Press (q) to exit.")
answer = input("\n > ")
if answer == "q":
exit()
elif answer == "1":
warrior.print()
print(w)
start()
elif answer == "2":
dwarf.print()
print(x)
start()
elif answer == "3":
rogue.print()
print(y)
start()
elif answer == "4":
elf.print()
print(z)
start()
else:
start()
start()