Commit b359d526 by BellCodeEditor

save project

parent d3707a55
Showing with 2 additions and 3 deletions
...@@ -4,11 +4,11 @@ class hero: ...@@ -4,11 +4,11 @@ class hero:
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def upgrade(): def combat(self ,enemy):
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp+50 self.hp=self.hp+50
self.attack=self.attack+4 self.attack=self.attack+4
yase=hero("亚瑟",300,20) yase=hero("亚瑟",300,20)
houyi=hero("后羿",250,23) houyi=hero("后羿",250,23)
upgrade() upgrade()
print(houyi,hp) 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