Commit 1f55f245 by BellCodeEditor

save project

parent bbe9c0f1
Showing with 3 additions and 2 deletions
......@@ -23,13 +23,14 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄
def __init__(self,name):
def __init__(self,name,player_sb):
self.name = name
self.level = 1
self.hp = 200
self.attack = 50
self.max_hp = self.hp
print("角色"+self.name+"创建成功,角色类型为:",self.player_sb)
print("当前角色等级、血量、攻击分别为:",self.level,self.hp,self.attack)
player = Player("后羿")
print("玩家的血量值为:",player.hp)
......
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