Commit 531fb409 by BellCodeEditor

save project

parent 87f88b51
Showing with 8 additions and 9 deletions
...@@ -4,12 +4,12 @@ class Hero: ...@@ -4,12 +4,12 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero('yase',300,20)
yase.hp=350
def upgrade(): def upgrade(self):
level=self.level+1 self.level=self.level+1
hp=self.hp+50 self.hp=self.hp+50
attack=self.attack+4 self.attack=self.attack+4
upgrade()
upgrade() yase=Hero('yase',300,20)
\ No newline at end of file yase.upgrade()
print('亚瑟的血量'+str(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