Commit ac4e2e81 by BellCodeEditor

save project

parent f067a9ec
Showing with 37 additions and 2 deletions
......@@ -19,10 +19,10 @@ class Hero:
class Player(Hero):
def __init__(self, name):
super().__init__(name)
#elf.level = 1
self.level = 1
self.hp = 200
self.attack = 50
#self.name = name
self.name = name
yase = Hero("垭瑟")
houyi= Hero("后羿")
......
class dog:
def __init__(self):
self.footnum = 4
self.eyenum =2
self.head = 1
self.earsnum = 2
self.skin = "while"
def run(self):
print("狗狗飞快地跑起来")
class husky(dog):
def __init__(self):
self.skin="black"
coco = husky()
print(coco.skin)
\ No newline at end of file
class cat:
def __init__(self):
self.footnum=4
self.eyenum=2
self.head=1
self.earsnum=2
self.skin="black"
def run(self):
print("小猫飞快地跑起来")
def skill(self,prey):
print("小猫抓住了"+prey)
role=cat()
role.skill("老鼠")
\ 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