Commit 1ecab5ac by BellCodeEditor

auto save

parent 408536d7
Showing with 4 additions and 8 deletions
...@@ -23,17 +23,13 @@ class Hero: ...@@ -23,17 +23,13 @@ class Hero:
class Player(): class Player():
def __init__(self,name,Hero_type): def __init__(self,name):
super(Player,self). __init__(name)
self.level=1 self.level=1
self.hp=200 self.hp=200
self.attack=50 self.attack=50
self.Hero_type = Hero_type
print('角色名称'+self.name+'创建成功,英雄类型为'+self.Hero_type)
print('当前等级,生命,攻击为',houyi.level,houyi.hp,houyi.attack)
houyi=Player()
yase=Player
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
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