Commit 4b7400f6 by BellCodeEditor

save project

parent e39eb497
Showing with 7 additions and 3 deletions
...@@ -24,9 +24,12 @@ class Hero: # 英雄类 ...@@ -24,9 +24,12 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄 class Player(Hero): # 玩家英雄
def __init__(self,name): def __init__(self,name):
super(Player,self)._init_(name)
self.hp = 150 self.hp = 150
self.attack = 10 self.attack = 10
self.hero_type = hero_type
print(self.name + '创建成功,类型为:' + self.hero_type)
print('等级,血量,攻击力:' + self.level,self.hp,self.attack)
player = Player("后羿") houyi = Player('后裔','射手')
print("玩家的血量值为:",player.hp) yase = Hero('亚瑟')
print("玩家的攻击力为:",player.attack) \ 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