Commit 5b93e123 by BellCodeEditor

save project

parent 6f7f01ab
Showing with 9 additions and 7 deletions
...@@ -18,13 +18,15 @@ class Hero(object): ...@@ -18,13 +18,15 @@ class Hero(object):
info4 = enemy.name + "阵亡,游戏结束" info4 = enemy.name + "阵亡,游戏结束"
info = info1+info2+info4 info = info1+info2+info4
print(info) print(info)
class player(Hero):
def __init__(self,name):
super().__init__(name)
self.hp = 250
self.attack = 40
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= player("后羿")
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi)
yase.combat(houyi) 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