Commit 6f7647d9 by BellCodeEditor

save project

parent da60e227
Showing with 11 additions and 2 deletions
......@@ -16,7 +16,17 @@ class Hero(object):
info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值'
print(info1 + info2 + info3)
class player(Hero):
def __init__(self, name):
super().__init__(name)
self.hp = 50
self.attack = 50
player = player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的功击力为:",player.attack)
yase = Hero("垭瑟")
houyi= Hero("后羿")
yase.combat(houyi)
\ No newline at end of file
yase.combat(houyi)
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