Commit dbb77406 by BellCodeEditor

save project

parent 2f1ddbc5
Showing with 8 additions and 7 deletions
......@@ -14,12 +14,13 @@ class Hero:
print(info)
exit()
class Player(Hero):
def __init__(self,name):
self().__init__(name)
def __init__(self,name,hero_type):
self(Player,self).__init__(name)
self.hp = 200
self.attack = 50
player = Player("后一")
print("血量为:",player.hp)
print("血量为:",player.attack)
self.hero_type = hero_type
print("血量为:",self.hero_type)
print("血量为:",self.level,self.hp,self.attack)
\ No newline at end of file
houyi = Player("后一","射手")
yase = Hero("垭瑟")
\ No newline at end of file
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