Commit 37ee97f3 by BellCodeEditor

save project

parent bd4b1a88
Showing with 8 additions and 10 deletions
...@@ -5,15 +5,13 @@ class hero: ...@@ -5,15 +5,13 @@ class hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
ren.level += 1 self.level += 1
ren.hp+=50 self.hp+=50
ren.attack+=4 self.attack+=4
def npgrade(): ren=hero("亚瑟",300,20)
zhu.level += 1 zhu=hero("后羿",250,23)
zhu.hp+=50 ren.upgrade()
zhu.attack+=4 zhu.upgrade()
ren=hero("亚瑟","300","20")
zhu=hero("后羿","250","23")
print(ren.hp) print(ren.hp)
print(zhu.hp) print(zhu.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