Commit b67a91ab by BellCodeEditor

save project

parent 8344717c
Showing with 13 additions and 9 deletions
...@@ -4,12 +4,16 @@ class Hero: ...@@ -4,12 +4,16 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=Hero("亚瑟",300,20)
houyi=Hero("后羿",250,23)
def upgradse(): def upgradse(self):
yase.level=yase+1 self.level=yase+1
yase.hp=yase.hp+50 self.hp=houyi.hp+50
yase.attack=yase.attack+4 self.attack=.attack+4
upgrade() houyi = Hero("后羿",240,213)
upgrade() houyi.upgrade()
\ No newline at end of file print("等级:",houyi.level)
print("血量为:",hoouyi.hp)
print("攻击力为:",houyi.attack)
upgrade()
upgrade()
\ 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