Commit 844942a0 by BellCodeEditor

save project

parent bbd1318e
Showing with 8 additions and 14 deletions
......@@ -3,23 +3,17 @@ class Hero:
self.level=1
self.hp=hp
self.attack=attack
yase=Hero('亚瑟',300,20)
hoyi=Hero('后裔',250,23)
def upgrade():
yase.level=yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
def npgrade():
hoyi.level=yase.level+1
hoyi.hp=yase.hp+25
hoyi.attack=yase.attack+11
def upgrade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero('亚瑟',300,20)
hoyi=Hero('后裔',250,23)
yase.upgrade()
upgrade()
upgrade()
npgrade()
npgrade()
print('亚瑟的等级为:',yase.level)
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