Commit f8bdeda8 by BellCodeEditor

save project

parent 3b401617
Showing with 6 additions and 7 deletions
...@@ -4,13 +4,12 @@ class hero: ...@@ -4,13 +4,12 @@ class hero:
self.name= name self.name= name
self.hp= hp self.hp= hp
self.attack= attack self.attack= attack
def upgrade(self):
def upgrade(): yase.level+=1
yase.level+=1 yase.hp+=50
yase.hp+=50 yase.attack+=4
yase.attack+=4
yase =hero("亚瑟",300,20) yase =hero("亚瑟",300,20)
houyi =hero("后羿",240,23) houyi =hero("后羿",240,23)
print("yase的血量值为:"yase.hp) print("yase的血量值为:"yase.hp)
print("houyi的血量值为:"houyi.hp) houyi("houyi的血量值为:"houyi.hp)
\ No newline at end of file \ 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