Commit 8681c6a8 by BellCodeEditor

auto save

parent 6ec5f30b
Showing with 9 additions and 7 deletions
...@@ -23,12 +23,14 @@ class Hero: # 英雄类 ...@@ -23,12 +23,14 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄 class Player(Hero): # 玩家英雄
def__init__(self,name): def __init__(self,name):
super(Player, self).__init__(name)
self.level = 1
self.hp = 10 self.hp = 10
self.attack = 0 self.attack = 0
self.max_hp = self.hp
print("角色"+seif.name+"创建成功,英雄类型为:" self.hero_type)
print("当前等级、")
player = Player("普京") pj=Player("普京""战斗家")
print("玩家的血量值为:",player.hp) lx=Hero("老西")
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