Commit 63a0c3f3 by BellCodeEditor

auto save

parent 82575b8f
Showing with 3 additions and 3 deletions
...@@ -24,7 +24,7 @@ class Hero: ...@@ -24,7 +24,7 @@ class Hero:
print("-"*30) print("-"*30)
class Player(Hero): class Player(Hero):
def __init__(self,name,hero_type): def __init__(self,name,hero_type):
super(Player,self).__init__(name) super().__init__(name)
self.HP=200 self.HP=200
self.attack=50 self.attack=50
self.hero_type=hero_type self.hero_type=hero_type
...@@ -34,5 +34,5 @@ class Player(Hero): ...@@ -34,5 +34,5 @@ class Player(Hero):
houyi=Player("后羿","射手") houyi=Player("后羿","射手")
# print(yase.HP) # print(yase.HP)
# print(houyi.HP) # print(houyi.HP)
yase.combat(houyi)
houyi.combat(yase)
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