Commit 8e7a6b60 by BellCodeEditor

save project

parent fca60e3b
Showing with 4 additions and 4 deletions
...@@ -4,10 +4,10 @@ class Hero: ...@@ -4,10 +4,10 @@ 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():
self.level1=self.level1+1 yase.level1=yase.level1+1
self.hp=self.hp+50 yase.hp=yase.hp+50
self.attack=self.attack+4 yase.attack=yase.attack+4
yase = Hero("亚瑟"30020) yase = Hero("亚瑟"30020)
print("亚瑟的血量为",yase.hp) print("亚瑟的血量为",yase.hp)
......
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