Commit 18c3b0c5 by BellCodeEditor

save project

parent e481bcb0
Showing with 3 additions and 2 deletions
...@@ -4,7 +4,7 @@ class Hero: ...@@ -4,7 +4,7 @@ class Hero:
self.hp=hp self.hp=hp
self.name=name self.name=name
self.attack = attack self.attack = attack
def uplevel(): def uplevel(self):
sb.level=sb.level+1 sb.level=sb.level+1
sb.hp = sb.hp + 10000 sb.hp = sb.hp + 10000
sb.attack=sb.attack+200 sb.attack=sb.attack+200
...@@ -13,7 +13,7 @@ sb = Hero("sb",10000,100) ...@@ -13,7 +13,7 @@ sb = Hero("sb",10000,100)
ff= Hero("ff",10000,100) ff= Hero("ff",10000,100)
print(sb.name+"sb1:"+str(sb.attack)) print(sb.name+"sb1:"+str(sb.attack))
print(sb.name+"ff1:"+str(sb.attack)) print(sb.name+"ff1:"+str(sb.attack))
sb.uplevel() uplevel()
ff.uplevel() ff.uplevel()
print(sb.name+"sbn:"+str(sb.attack)) print(sb.name+"sbn:"+str(sb.attack))
print(sb.name+"ffn:"+str(sb.attack)) print(sb.name+"ffn:"+str(sb.attack))
\ 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