Commit 376db15f by BellCodeEditor

save project

parent f8f9b8c5
Showing with 8 additions and 6 deletions
...@@ -23,11 +23,12 @@ class Hero: # 英雄类 ...@@ -23,11 +23,12 @@ class Hero: # 英雄类
class Player(Hero): # 玩家英雄 class Player(Hero): # 玩家英雄
def __init__(self,name): def __init__(self,name,hero_type,hp,attack):
super().__init__(name) super().__init__(name)
self.hp = 99999999999999999999 self.hp = hp
self.attack = 0.0001 self.attack = attack
self.hero_type = hero_type
print("名字,类型:",self.name,self.hero)
print(":",player.attack)
player = Player("后羿") player1 = Player("后羿",'射手'24040)
print("玩家的血量值为:",player.hp) \ No newline at end of file
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