Commit db2ed9b7 by BellCodeEditor

save project

parent 0392693a
Showing with 7 additions and 7 deletions
...@@ -4,11 +4,10 @@ class Hero: ...@@ -4,11 +4,10 @@ class Hero:
self.level=level self.level=level
self.HP=HP self.HP=HP
self.attack=attack self.attack=attack
def upgrade(self):
self.level+=1
self.HP+=50
self.attack+=4
yase=Hero("亚瑟",1,300,20) yase=Hero("亚瑟",1,300,20)
def upgrade(): yase.upgrade()
yase.level+=1 print(yase.level)
yase.HP+=50 \ No newline at end of file
yase.attack+=4
upgrade()
upgrade()
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