Commit ee372c64 by BellCodeEditor

save project

parent c786961f
Showing with 10 additions and 1 deletions
...@@ -15,7 +15,16 @@ class Hero(object): ...@@ -15,7 +15,16 @@ class Hero(object):
else: else:
info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值' info3 = enemy.name + '还剩下' + str(enemy.hp) + '点生命值'
print(info1 + info2 + info3) print(info1 + info2 + info3)
class Player(Hero):
def __init__(self, name):
self.level = 1
self.hp = 3000
self.attack = 500
self.name = name
Player=player("后羿")
print("玩家的血量为:",player.hp)
print("玩家的攻击力为:",player.)
yase = Hero("垭瑟") 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