Commit deb8d502 by BellCodeEditor

auto save

parent 1cf9f5c8
Showing with 17 additions and 15 deletions
class Dog: # 狗类 # 创建玩家类Player放入参数Hero
def __init__(self):
self.footNum = 4 # 腿
self.eyeNum = 2 # 眼睛
self.head = 1 # 头
self.earsNum = 2 # 耳朵
self.skin = "white"
def run(self): # 创建__init__()函数方法并放入参数self,name,hero_type
print("狗狗飞快的跑起来")
# 使用super()函数继承父类方法__init__()并放入参数name
class Husky(Dog): # 哈士奇类 # 重写英雄血量200
def __init__(self):
??
coco = Husky() # 重写英雄攻击力50
print(coco.skin)
\ No newline at end of file # 重写英雄类型
# 角色xx创建成功
# 当前等级, 血量,攻击力分别为 1,200,50
# 创建对象houyi参数"后羿", "射手"
# 创建对象yase
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