Commit 5176f46e by BellCodeEditor

save project

parent 62939b45
Showing with 8 additions and 2 deletions
...@@ -4,6 +4,11 @@ class Hero: ...@@ -4,6 +4,11 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(self):
self.levelyese.level+1
self.hp=yese.hp+50
self.attack=yese.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)
...@@ -11,9 +16,9 @@ print(yase.attack) ...@@ -11,9 +16,9 @@ print(yase.attack)
print(hy.attack) print(hy.attack)
print(k.attack) print(k.attack)
def upgrade(): def upgrade():
yese.level=yese.level+1 yese.levelyese.level+1
yese.hp=yese.hp+50 yese.hp=yese.hp+50
yese.attack=yese.attack+4 yese.attack=yese.attack+4
upgrade() upgrade()=
upgrade() upgrade()
\ 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