Commit 4bb31a21 by BellCodeEditor

save project

parent 77916180
Showing with 12 additions and 1 deletions
...@@ -14,9 +14,20 @@ class Hero(object): ...@@ -14,9 +14,20 @@ class Hero(object):
print(info) print(info)
else: else:
print(enemy.name+"阵亡了"+"游戏结束") print(enemy.name+"阵亡了"+"游戏结束")
exit() # exit()
yase = Hero("垭瑟") yase = Hero("垭瑟")
houyi= Hero("后羿") houyi= Hero("后羿")
for i in range(9): for i in range(9):
yase.combat(houyi) yase.combat(houyi)
class Player(Hero):
def __init__(self,name,type):
super().__init__(name)
self.hp=200
self.attack=50
self.type=type
print("成功创建角色"+self.name+"它的生命有"+str(self.hp)+"它的攻击力是"+str(self.attack))
abc=Player("yase","sheshou")
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