Commit e2f92243 by BellCodeEditor

save project

parent f6f8e3f8
Showing with 6 additions and 4 deletions
......@@ -23,10 +23,12 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄
def __init__(self,name):
def __init__(self,name,hero__type):
super().__init__(name)
self.hp=450
self.attack=42
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
self.hero__type=hero__type
print("角色"+self.name+"已进入战场,英雄类型为:"+self.hero__type)
print("当前等级,血量,攻击分别为:",self.level,self.hp,self.attack)
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