Commit b67a91ab by BellCodeEditor

save project

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