Commit 4b7400f6 by BellCodeEditor

save project

parent e39eb497
Showing with 8 additions and 4 deletions
......@@ -24,9 +24,12 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄
def __init__(self,name):
super(Player,self)._init_(name)
self.hp = 150
self.attack = 10
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)
houyi = Player('后裔','射手')
yase = Hero('亚瑟')
\ 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