Commit 76a47570 by BellCodeEditor

save project

parent 0f0fa545
Showing with 33 additions and 18 deletions
class Dog: # 狗类 class Hero:
def __init__(self): def _init_(self,hp,attack,name):
self.footNum = 4 # 腿 self.leve1=1
self.eyeNum = 2 # 眼睛 self.hp=hp
self.head = 1 # 头 self.attack=attack
self.earsNum = 2 # 耳朵 self.name=name
self.skin = "white" #def upgrade(self):
# self.leve1=self.leve1+1
# self.hp=self.hp+50
# self.attack=attack+4
def combat(self,enemy):
if enemy.hp>0
enemy.hp-= self.attack
info1=self.name+"对"+enemy.name+"发起进攻,"
info2="造成"+str(self.attack)+"点伤害,"
info3=enemy.name+"剩余血量"+str(enemy.hp)+"点"
info=info1+info2+info3
print(into)
else:
info3=enemy.name+"阵亡,游戏结束"
info=info1+info2+info3
print(into)
exit()
class player(hero):
def _init_(name)
self.hp=200
self.attack=50
self.hero_type=hero_type
houyi=player("后羿""射手")
yase=hero("亚瑟")
houyi=player("后羿")
houyicombat(yase)
\ No newline at end of file
def run(self):
print("狗狗飞快的跑起来")
class Husky(Dog): # 哈士奇类
def __init__(self):
??
coco = Husky()
print(coco.skin)
\ 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