Commit 29c1fc59 by BellCodeEditor

save project

parent 63ec24cd
Showing with 27 additions and 0 deletions
class Here:
def __init__(self,name):
self.name = name
self.level = 1
self.hp = 250
self.attack=40
self.max_hp = self.hp
def combat(self,enemy):
info1=self.name+"对"+enemy.name+"发起进攻"
else:
info3 = enemy.name+"阵亡,游戏结束"
info = info1+info2+info3
class Player(Hero):
def __init__(self,name,herotype):
super().__init__(name)
self.hp=200
self.attack=50
self.type=herotype
print(self.name+"已经创建"+self.type)
print(self.name+"的等级,血量,攻击力分别是:"+self.type)
Player = Player("后羿","射手")
\ 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