Commit 2f0a655e by BellCodeEditor

save project

parent d6e455f4
Showing with 7 additions and 5 deletions
...@@ -27,8 +27,10 @@ class Hero: # 英雄类 ...@@ -27,8 +27,10 @@ class Hero: # 英雄类
class Player(): # 玩家英雄 class Player(): # 玩家英雄
def __init__(self,name): def __init__(self,name):
print('角色'+self.name+'创建成功,类型为',self_herotype) print('角色'+self.name+'创建成功,类型为',self_herotype)
print('当前怪兽,等级,血量,攻击力为',self.lv,self.hp,self.atk) print('当前怪兽,等级,血量,攻击力为',self.lv,self.hp,self.atk)
player = Player("后羿") player = Player("后羿")
print("玩家的血量值为:",player.hp) print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack) print("玩家的攻击力为:",player.attack)
houyi=player
print('-'*30)
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