Commit 50ab48c3 by BellCodeEditor

save project

parent f1c8a1e6
Showing with 10 additions and 4 deletions
...@@ -4,7 +4,13 @@ class Hero: ...@@ -4,7 +4,13 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
白起=Hero('白起',4500,130) 亚瑟=Hero('亚瑟',4500,130)
花木兰=Hero('花木兰',3900,155) 后羿=Hero('后羿',3900,155)
print("白起攻击力为:",白起.attack) print("亚瑟攻击力为:",亚瑟.attack)
print("花木兰攻击力为:",花木兰.attack) print("后羿攻击力为:",后羿.attack)
def upgrade():
亚瑟.attack=亚瑟.attack+20
亚瑟.level=亚瑟.level+1
亚瑟.hp=亚瑟.hp+200
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