Commit db9bde6a by BellCodeEditor

save project

parent e50c3652
Showing with 9 additions and 0 deletions
...@@ -7,5 +7,13 @@ class Hero(): ...@@ -7,5 +7,13 @@ class Hero():
yase = Hero('亚瑟',300,20) yase = Hero('亚瑟',300,20)
dunshan=Hero('盾山',500,10) dunshan=Hero('盾山',500,10)
def upgrade():
yase.level += 1
yase.hp += 50
yase.attack += 4
upgrade()
upgrade()
upgrade()
print('亚瑟的攻击力为:',yase.attack) print('亚瑟的攻击力为:',yase.attack)
print('盾山的血量为:',dunshan.hp) print('盾山的血量为:',dunshan.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