Commit 8b04e393 by BellCodeEditor

save project

parent ce44dbd8
Showing with 9 additions and 3 deletions
......@@ -15,6 +15,7 @@ class Hero: # 英雄类
info3 = enemy.name+"还剩下"+str(enemy.hp)+"血量"
info = info1+info2+info3
print(info)
exit()
else:
info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3
......@@ -22,9 +23,14 @@ class Hero: # 英雄类
exit()
class Player(): # 玩家英雄
def __init__(self,name):
???
class Player(Hero): # 玩家英雄
def __init__(self,name,hero_type):
super(Player,self).__init__(name)
self.hp = 200
self.attack = 50
self.hero_type = hero_type
print("角色" + self.name"创建成功,英雄类型为:"self.hero_type)
player = Player("后羿")
......
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