Commit 9aa37012 by BellCodeEditor

save project

parent c3f36814
Showing with 13 additions and 0 deletions
...@@ -6,5 +6,17 @@ class hero: ...@@ -6,5 +6,17 @@ class hero:
self.attack=attack self.attack=attack
Houyi=hero('Houyi',250,25) Houyi=hero('Houyi',250,25)
Yase=hero('Yase',300,20) Yase=hero('Yase',300,20)
def upgrade():
Yase.level=Yase.level+1
Yase.hp=Yase.hp+50
Yase.attack=Yase.attack+5
upgrade()
upgrade()
def upgrade2():
Houyi.level=Houyi.level+1
Houyi.hp=Houyi.hp+30
Houyi.attack=Houyi.attack+50
upgrade2()
upgrade2()
print(Houyi.attack) print(Houyi.attack)
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