Commit 61df6cc5 by BellCodeEditor

save project

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