Commit 1796f2ea by BellCodeEditor

auto save

parent ac5449b0
Showing with 7 additions and 4 deletions
......@@ -23,12 +23,15 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄
def __init__(self,name):
def __init__(self,name,type):
super().__init__(name)
self.hp=240
self.attack=24
self.type=type
print("有英雄创建成功,英雄名称:"+self.name+"英雄类型:"+self.type)
print("英雄血量",self.hp,"英雄攻击力:",self.attack,"英雄级别:",self.level)
player = Player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
player = Player("后羿","射手")
yase=Player("亚瑟","战士")
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