Commit 498d6532 by BellCodeEditor

save project

parent 70850cf8
Showing with 14 additions and 0 deletions
class Hero:
def __init__(self,level,name,hp,attack):
self.level=level
self.name=name
self.hp=hp*(0.9+0.1*level)
self.attack=attack*(0.9+0.1*level)
def level_e(self):
self.level+=1
self.hp+=50
self.attack+=5
yase=Hero(3,"亚瑟",300,10)
yase.level_e()
yase.level_e()
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