Commit b689e487 by BellCodeEditor

save project

parent c9c84ecb
Showing with 31 additions and 5 deletions
class hero: class ren:
def __init__(self): def __init__(self,name,hp,aat,s):
self.level=1 self.name=name
self.hp=300 self.level=8
self.attack=2000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 self.HP=hp
self.attact=aat
self.speed=s
self.show=True
print("成功创建人:",self.name)
print(self.name,"的血量是:",self.HP,"\n攻击力是:",self.attact)
def jiasu(self):
self.speed+=1
print("你的速度增加了1")
print("当前你的速度是:",self.speed)
def wuli(self):
self.attact+=10
print("你的武力增加了10")
print("当前你的武力是:",self.attact)
def huixie(self):
self.HP+=1
print("你的生命增加了1")
print("当前你的生命是:",self.HP)
def duomaomao(self):
self.show=False
print("窝藏起来了,你看不见我")
fangfang=ren("放放",100,100000,100)
fangfang.jiasu()
fangfang.wuli()
fangfang.duomaomao()
fangfang.huixie()
\ 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