Commit ffdbf7d4 by BellCodeEditor

save project

parent 06c75bbb
Showing with 8 additions and 9 deletions
...@@ -5,19 +5,17 @@ class Hero: ...@@ -5,19 +5,17 @@ class Hero:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def upgrade(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+75 self.hp=self.hp+75
yase.attack=yase.attack+5 self.attack=self.attack+5
upgrade()
upgrade()
upgrade()
upgrade()
upgrade()
yase=Hero('yase',300,20) yase=Hero('yase',300,20)
hy=Hero('hy',250,23) hy=Hero('hy',250,23)
k=Hero('K',10000,150) k=Hero('K',10000,150)
upgrade()
print(yase.attack) print(yase.attack)
print(hy.attack) print(hy.attack)
print(k.attack) print(k.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