Commit 22eeb7c1 by BellCodeEditor

save project

parent 2ed30f26
Showing with 11 additions and 10 deletions
...@@ -4,13 +4,14 @@ class Hero: ...@@ -4,13 +4,14 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
aw.level=aw.level+1 self.level=jg.level+1
aw.hp=aw.hp+50 self.hp=jg.hp+50
aw.attack=aw.attack+4 self.attack=jg.attack+4
aw=Hero('aw',300,20) jg=Hero('jg',240,23)
print('aw',aw.hp)
upgrade() jg.upgrade()
upgrade() print('等级',jg.level)
print('2次后为',aw.hp) print('血量',jg.hp)
\ No newline at end of file print('攻击',jg.attack)
\ No newline at end of file
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