Commit e0714c6e by BellCodeEditor

save project

parent bd3d1d49
Showing with 4 additions and 3 deletions
...@@ -23,14 +23,15 @@ class Hero: # 英雄类 ...@@ -23,14 +23,15 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄 class Player(Hero): # 玩家英雄
def __init__(self,name): def __init__(self,name,leixing):
super().__init__(name) super().__init__(name)
self.level=1 self.level=1
self.hp=200 self.hp=200
self.attack=50 self.attack=50
print("角色"+self.name+"创建成功 英雄类型为射手") self.leixing=leixing
print("角色"+self.name+"创建成功 英雄类型为"+self.leixing)
print("当前等级.血量.攻击力为"+str(self.level)+str(self.hp)+str(self.attack)) print("当前等级.血量.攻击力为"+str(self.level)+str(self.hp)+str(self.attack))
Player = Player("后羿") Player = 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