Commit 9e012716 by BellCodeEditor

save project

parent e9461696
Showing with 9 additions and 11 deletions
...@@ -10,15 +10,13 @@ k=Hero("凯",240,23) ...@@ -10,15 +10,13 @@ k=Hero("凯",240,23)
print("yase的血量为:",yase.hp) print("yase的血量为:",yase.hp)
print("yase的攻击为:",yase.attack) print("yase的攻击为:",yase.attack)
def upgrade():
yase.level = yase.level+1
yase.hp=yase.hp+50
yase.attack=yase.attack+4
upgrade()
upgrade()
print("升级连词后,亚瑟的血量为:"yase.hp) print("升级连词后,亚瑟的血量为:"yase.hp)
def upgrade(self): def upgrade(self):
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp+50 self.hp=self.hp+50
self.attack=self.attack+4 self.attack=self.attack+4
\ No newline at end of file houyi("ss",100,20)
houyi.upgrade()
print(houyi.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