Commit fc7df958 by BellCodeEditor

save project

parent e994ed18
Showing with 7 additions and 7 deletions
...@@ -4,11 +4,11 @@ class Hero: ...@@ -4,11 +4,11 @@ class Hero:
self.name=name self.name=name
self.hp=help self.hp=help
self.attack=attack self.attack=attack
def upgrade(self): def upgrade(self):
self.level=yase.level+1 self.level=self.level+1
self.hp=yase.hp+50 self.hp=self.hp+50
self.attack=yase.attack+4 self.attack=self.attack+4
houyi=Hero("后羿",240,23) houyi=Hero("后羿",240,23)
print=Hero("初始值:",houyi.hp)
houyi.upgrade() houyi.upgrade()
print=Hero("升级后:",houyi.hp) print("血量为:",houyi.hp)
\ No newline at end of file print("攻击力为:",houyi.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