Commit 0fc22e20 by BellCodeEditor

save project

parent 13e161c4
Showing with 7 additions and 6 deletions
...@@ -6,11 +6,12 @@ class Hero: ...@@ -6,11 +6,12 @@ class Hero:
self.attack= attack self.attack= attack
def upgrade(self): def upgrade(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+50 self.hp=self.hp+50
yase.attack=yase.attack+4 self.attack=self.attack+4
yase = Hero("yase",300,20) houyi= Hero("yase",300,20)
print(yase.hp)
houyi.upgrade() houyi.upgrade()
print(yase.hp) print("等:",houyi.level)
print("血:",houyi.hp)
print("攻:",houyi.attack)
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