Commit b2f32985 by BellCodeEditor

save project

parent ef39df1c
Showing with 24 additions and 5 deletions
class hero:
def __init__(self):
self.level=1
self.hp=300
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000
class Hero:
def __init__(self,name,hp,gjl,s):
self.name=name
self.level=15
self.HP=hp
self.attack=gjl
self.speed=s
print("成功创建英雄")
print(self.name,"的血量是: ",self.HP,"\n攻击力是: ",self.attack)
def jiasu(self):
self.speed+=10
print("你的速度增加了10")
print("此时英雄是",self.speed)
def yinshen(self):
print("我隐身起来了,可以偷袭别人")
def shazhupao(self):
print("我使用鲨嘴炮,可以击退别人")
jingke=Hero("荆轲",500,1700,30)
jingke.jiasu()
jingke.yinshen()
jingke.shazhupao()
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