Commit 20889606 by BellCodeEditor

save project

parent 8769e7c3
Showing with 11 additions and 4 deletions
...@@ -15,13 +15,19 @@ class hero: ...@@ -15,13 +15,19 @@ class hero:
print(info1+info2+info3) print(info1+info2+info3)
class player(hero): class player(hero):
def __init__(self,name): def __init__(self,name,hero_type):
super().__init__(name) super().__init__(name)
self.hp=200 self.hp=200
self.attack=70 self.attack=70
Player = player("后羿") self.hero_type=hero_type
print("玩家攻击力为",Player.attack)
print("玩家血量为",Player.hp) print("角色"+self.name+"创建成功,英雄类型为:",self.hero_type)
print("当前等级、血量、攻击力分别为",self.level,self.hp,self.attack)
Player = player("后羿","射手")
#print("玩家攻击力为",Player.attack)
#print("玩家血量为",Player.hp)
#print()
#ys=hero("亚瑟") #ys=hero("亚瑟")
#hy=hero("后羿") #hy=hero("后羿")
#ys.combat(hy) #ys.combat(hy)
\ 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