Commit 86ac8e3b by BellCodeEditor

save project

parent f5de2acd
Showing with 10 additions and 1 deletions
...@@ -3,9 +3,17 @@ class Hero(): ...@@ -3,9 +3,17 @@ class Hero():
self.level=1 self.level=1
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def update():
damo.level=damo.level+1
damo.hp=damo.hp+100
damo.atack=damo.attack+5
damo=Hero("达摩",300,50) damo=Hero("达摩",300,50)
houyi=Hero("后羿",250,80) houyi=Hero("后羿",250,80)
print("初始血量为",damo.hp)
update()
update()
print("升两级血量为",damo.hp)
print(damo.hp) print(damo.hp)
print(houyi.hp) 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