Commit f4ca257f by BellCodeEditor

save project

parent 57f6e5c2
Showing with 7 additions and 5 deletions
......@@ -5,11 +5,12 @@ class Hero():
self.level=1
self.attack=attack
def upgrade(self):
self.level = self.level + 1
self.hp = self.hp + 50
self.attack = self.attack + 20
yase = Hero("亚瑟",300,200)
houyi = Hero("后裔",240,240)
def upgrade():
yase.level = yase.level + 1
yase.hp = yase.hp + 50
yase.attack = yase.attack + 20
upgrade()
yase.upgrade()
houyi.upgrade()
print(yase.level,yase.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