Commit d7b2eae6 by BellCodeEditor

save project

parent bf5360cd
Showing with 7 additions and 6 deletions
...@@ -4,15 +4,15 @@ class Hero: ...@@ -4,15 +4,15 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(self):
self.level+=1
self.hp+=50
self.attack+=4
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
k=Hero('K',5600,199) k=Hero('K',5600,199)
def upgrade(): yase.upgrade()
self.level+=1 yase.upgrade()
self.hp+=50
self.attack+=4
upgrade()
upgrade()
print(yase.level) print(yase.level)
print(yase.hp) print(yase.hp)
print(yase.attack) print(yase.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