Commit 7a38c4f5 by BellCodeEditor

auto save

parent 46d6d2e4
class Hero:
def __init__(self,name):
self.level = 1
self.hp = 250
self.attack = 40
self.name = name
class player(Hero):
def __init__(self,name,hero_type):
super().__init__(name)
self.hp = 200
self.attack = 50
self.hero_type = hero_type
wukong= player("后羿","射手")
yase = Hero("鸭舌")
print("角色"+houyi.name+"创建成功,yi")
print()
\ No newline at end of file
class Player(Hero):
def __init__(self,name):
self.level = 1
self.name = name
self.hp = 20000000000000000000000000000000000000000000000000000
self.attack = 20000000000000000000000000000000000000000000000000000
player = player("后羿")
print("玩家的血量值为:",player.hp)
print("玩家的攻击力为:",player.attack)
\ 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