Commit cadc3b8c by BellCodeEditor

save project

parent f80db15a
Showing with 13 additions and 1 deletions
...@@ -4,7 +4,18 @@ class Hero(): ...@@ -4,7 +4,18 @@ class Hero():
self.name = name self.name = name
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
def upgrade():
yase.level += 1
yase.hp +=50
yase.attack +=4
yase = Hero("亚瑟",300,26) yase = Hero("亚瑟",300,26)
houy1 = Hero("后翼",230,25)
print("亚瑟的血量是:",yase.hp) print("亚瑟的血量是:",yase.hp)
upgrade()
upgrade()
upgrade()
print("亚瑟的血量是:",yase.hp)
houy1 = Hero("后翼",230,25)
print("后翼的血量是: ",houy1.hp) print("后翼的血量是: ",houy1.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