Commit c9b50148 by BellCodeEditor

save project

parent 5fcf06c2
Showing with 8 additions and 6 deletions
class hero: class hero:
def __init__(self,name,hp,attack): def __init__(self,name,hp,attack):
self.level=1
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=hero('亚瑟',300,20) yase=hero('亚瑟',300,20)
yase=hero('后羿',250,99999) houyi=hero('后羿',250,99999)
def upgrade() def upgrade():
yase.leve1=yase.leve+1 yase.level=yase.level+1
yase.hp300=yase.hp+50 yase.hp=yase.hp+50
yase.attack=yase.attack+4 yase.attack=yase.attack+4
upgrade upgrade()
print("亚瑟血量",yase.hp)
......
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