Commit bbed8474 by BellCodeEditor

save project

parent 6e8d76f7
Showing with 12 additions and 5 deletions
class hero:
def __init__(self,name,hp,attack):
def __init__(self,name):
self.level=1
self.name=name
self.hp=hp
self.attack=attack
self.hp=250
self.attack=40
# def upgrade(self):
# self.level=self.level+1
......@@ -20,6 +20,12 @@ class hero:
ifor3=enemy.name+"已阵亡,游戏结束"
print(ifor1+ifor2+ifor3)
exit()
yase=hero("垭瑟",250,40)
houyi=hero("后羿",240,45)
class player(hero):
def __init__(self,name):
super().__init__(self)
self.hp=300
self.attack=99
yase=player("垭瑟")
houyi=player("后羿")
hero.combat(yase,houyi)
\ No newline at end of file
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or sign in to comment