Commit 6bbc55d1 by BellCodeEditor

save project

parent eb06b2b5
Showing with 5 additions and 5 deletions
...@@ -5,13 +5,13 @@ class Hero: ...@@ -5,13 +5,13 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade():
self.level=yase.level+1 self.level=yase.level+1
self.hp=yase.hp+50 self.hp=yase.hp+50
self.attack=yase.attack+40 self.attack=yase.attack+40
yase = Hero('亚索',700,34) yase=Hero('亚索',700,34)
yase.upgrade() yase.upgrade()
print("血量是:",yase.hp) print("血量是:",yase.hp)
print("等级是:",yase.level) print("等级是:",yase.level)
......
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