Commit 93af3849 by BellCodeEditor

save project

parent 8b9fd10b
Showing with 13 additions and 1 deletions
......@@ -15,10 +15,21 @@ class Hero(object):
info=info1+info2+info3
print(info)
else:
info3='对手死亡,游戏结束了。'
info3=enemy.name+'阵亡,游戏结束了。'
info=info1+info2+info3
print(info)
exit()
class Player(Hero):
def __init__(self,name):
self.level = 1
self.hp = 250
self.attack = 40
self.name = name
yase = Hero("垭瑟")
houyi= Hero("后羿")
player=Player('后羿')
print('玩家血量:',player.hp)
print('玩家攻击力:',player.attack)
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