Commit 7a2fe408 by BellCodeEditor

save project

parent 82672706
Showing with 5 additions and 5 deletions
...@@ -6,13 +6,13 @@ class Hero: ...@@ -6,13 +6,13 @@ class Hero:
self.attack= 20 self.attack= 20
def upgrade(): def upgrade():
bill.level=yase.level+1 bill.level=bill.level+1
bill.hp=yase.hp+500 bill.hp=bill.hp+500
bill.attack=yase.attack+4 bill.attack=bill.attack+4
bill = Hero("bbill",800,20) bill = Hero("bbill",800,20)
print("bill的初始血量为:",yase.hp) print("bill的初始血量为:",bill.hp)
upgrade() upgrade()
upgrade() upgrade()
print("升级2次后,bill的血量为:",yas.hp) print("升级2次后,bill的血量为:",bill.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