Commit efdd4ea7 by BellCodeEditor

save project

parent 539ab60a
Showing with 4 additions and 8 deletions
...@@ -4,12 +4,13 @@ class a: ...@@ -4,12 +4,13 @@ class a:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
yase=a('yase',300,20) def upgrade(self):
def upgrade():
yase.attack = yase.attack + 4 yase.attack = yase.attack + 4
yase.hp = yase.hp + 50 yase.hp = yase.hp + 50
yase.level = yase.level + 1 yase.level = yase.level + 1
upgrade() yase=Hero("垭瑟",300,20)
yase=a('yase',300,20)
yase.upgrade()
print(yase.level) print(yase.level)
...@@ -19,8 +20,4 @@ print(yase.level) ...@@ -19,8 +20,4 @@ print(yase.level)
print(yase.name) print(yase.name)
\ 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