Commit 221bd872 by BellCodeEditor

save project

parent e5e06bc3
Showing with 7 additions and 8 deletions
......@@ -20,15 +20,13 @@ class Hero(object):
print(info)
class player(Hero):
super().__init__(name):
self.level = 1
def __init__(self, name,hero_type):
super().__init__(name)
self.hp = 200
self.attack = 50
self.name = name
self.hero_type=hero_type
print("角色"+self.name+"创建成功,英雄类型为:"+hero_type)
print("当前等级、血量、攻击力分别为:"+str(self.level)+" "+str(self.attack)+" "+str(self.hp))
yase = Hero("垭瑟")
houyi= Hero("后羿")
houyi= 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