Commit 42a8c0d5 by BellCodeEditor

save project

parent 5ab5fdde
Showing with 7 additions and 4 deletions
...@@ -4,14 +4,16 @@ class Heor: ...@@ -4,14 +4,16 @@ class Heor:
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
self.name=name self.name=name
def upgrade(): def upgrade(self):
yase.level=yase.level+1 self.level=self.level+1
yase.hp=yase.hp+1 self.hp=self.hp+1
yase.attack=yase.attack+1 self.attack=self.attack+1
yase=Heor("亚瑟",300,20) yase=Heor("亚瑟",300,20)
houyi=Heor("后羿",250,23) houyi=Heor("后羿",250,23)
print("亚瑟的血量",yase.hp) print("亚瑟的血量",yase.hp)
print("后羿的血量",houyi.hp) print("后羿的血量",houyi.hp)
houyi.upgrade()
print("后羿的血量",houyi.hp)
\ 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