Commit 7be58b77 by BellCodeEditor

save project

parent ca556c46
Showing with 6 additions and 4 deletions
......@@ -19,14 +19,15 @@ class Hero(object):
exit()
class Player(Hero):
def __init__(self,name):
def __init__(self,name,hero_type):
super().__init__(name)
self.hp=230
self.attack=60
self.hero_type=hero_type
print(self.name+'创建成功!他是'+self.hero_type+'。')
print('他的参数是:',self.level,self.hp,self.attack)
yase = Hero("垭瑟")
houyi= Player("后羿")
houyi= Player("后羿",'杀手')
while True:
houyi.combat(yase)
yase.combat(houyi)
\ 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