Commit 1993aafb by BellCodeEditor

save project

parent 6d1862d6
Showing with 10 additions and 4 deletions
...@@ -6,6 +6,12 @@ class Hero(): ...@@ -6,6 +6,12 @@ class Hero():
self.name=name self.name=name
yase=Hero('亚瑟',300,30) yase=Hero('亚瑟',300,30)
houyi=Hero('后羿',250,23) houyi=Hero('后羿',250,23)
yase.level=yase.level+1 def upgrade():
yase.hp=yase.hp+50 yase.level=yase.level+1
yase.attack yase.hp=yase.hp+50
\ No newline at end of file yase.attack=yase.attack+4
upgrade()
upgrade()
print(yase.hp)
print(yase.attack)
print(yase.level)
\ 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