Commit f4a72745 by BellCodeEditor

save project

parent 54d72c3a
Showing with 12 additions and 4 deletions
...@@ -18,7 +18,15 @@ class Hero(object): ...@@ -18,7 +18,15 @@ class Hero(object):
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):
super().__init__(name)
self.hp=230
self.attack=55
yase = Hero("垭瑟") #yase = Hero("垭瑟")
houyi= Hero("后羿") #houyi= Hero("后羿")
yase.combat(houyi) #yase.combat(houyi)
\ No newline at end of file player = player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
\ 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