Commit b9b34922 by BellCodeEditor

save project

parent 06180a11
Showing with 9 additions and 8 deletions
...@@ -3,12 +3,13 @@ class Hero(): ...@@ -3,12 +3,13 @@ class Hero():
self.level=1 self.level=1
self.hq=300 self.hq=300
self.attack=20 self.attack=20
yase=Hero() def upgrade():
yase=Hero("亚瑟",300,20) self.level=self.level+1
houyi=Hero("后羿",240,23) self.hap=self.hap+50
self.attack=self.attack+4
self=Hero()
self=Hero("",300,20)
self=Hero("后羿",240,23)
print("亚瑟的血量为",yase.attack) print("亚瑟的血量为",yase.attack)
print( houyi.attack) print( houyi.attack)
def upgrade():
yase.level=yase.level+1 \ No newline at end of file
yase.hap=yase.hap+50
yase.attack=yase.attack+4
\ 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