Commit 34656ffb by BellCodeEditor

save project

parent 73190895
Showing with 7 additions and 6 deletions
...@@ -23,15 +23,16 @@ class Hero: ...@@ -23,15 +23,16 @@ class Hero:
class Player(Hero): class Player(Hero):
def__init__(self,name): def__init__(self,name,Hero,type):
super().def__init__(name) super(Player,self).__init__(name)
self.hp = 200 self.hp = 200
self.attack = 50 self.attack = 50
player = Player("后羿") self.hero = hero_type
print("玩家血量为:",player.hp) print("角色"+self.name+"创建成功,英雄类型为:",self.hero.type)
print("玩家攻击力为:",player.attack) print("当前等级,血量,攻击力为:",self.level,self.hp,self.attack)
houyi = Player("后羿","射手")
yase = Hero("垭瑟")
......
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