Commit b8eb775c by BellCodeEditor

save project

parent eb0a1c7a
Showing with 12 additions and 1 deletions
......@@ -2,8 +2,12 @@ class Hero:
def __init__(self,name):
self.level = 1
self.name =name
self.hp =2500
self.hp =250
self.attack = 50
def combat(self,enemy):
class Plarer(Hero)
def combat(self,enemy):
enemy.hp-=self.attack
info1=self.name+"对"+enemy.name+"发起攻击,"
......@@ -18,6 +22,10 @@ class Hero:
print(info)
exit()
class Plarer(Hero):
super()
class Plarer(Hero):
def __init__(self,name,hero_type):
super().__init__(name)
self.hp=200
......@@ -28,3 +36,6 @@ class Plarer(Hero):
houyi=Plarer("后羿","射手")
yase=Hero("亚瑟")
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