Commit 2cb814c7 by BellCodeEditor

save project

parent 50910f91
Showing with 8 additions and 9 deletions
...@@ -4,16 +4,15 @@ class Hero: ...@@ -4,16 +4,15 @@ class Hero:
self.name=name self.name=name
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
def updent(self):
def updent(): yase.level=yase.level+1
yase.level=yase.level+1 yase.hp=yase.hp+100
yase.hp=yase.hp+100 yase.attack=yase.attack+10
yase.attack=yase.attack+10 yase=Hero("亚瑟",300,200)
yase=s("亚瑟",300,200)
yase.updent() yase.updent()
print("等级:"+yase.level) print("等级:"+str(yase.level))
print("血量:"+yase.hp) print("血量:"+str(yase.hp))
print("攻击:"+yase.attack) print("攻击:"+str(yase.attack))
......
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