Commit a6902fcb by BellCodeEditor

auto save

parent c0889d16
Showing with 10 additions and 8 deletions
# 英雄角色类
class Hero(object):
class Hero:
def __init__(self, name):
self.level = 1
self.hp = 250
......@@ -18,12 +18,14 @@ class Hero(object):
c=beida.name+"阵亡,游戏结束"
abc=a+b+c
print(abc)
exit()
class player(Hero):
def __init__(self, name):
super().__init__(name)
self.hp = 250
self.attack = 40
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
player=player("后羿")
print(player.hp)
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