Commit 5479caf3 by BellCodeEditor

save project

parent 33d28861
Showing with 12 additions and 12 deletions
......@@ -4,15 +4,15 @@ class Hero:
self.name=name
self.hp=hp
self.attack=attack
sb=Hero("傻逼",300,20)
sd=Hero("沙雕",250,23)
#sb=Hero("傻逼",300,20)
#sd=Hero("沙雕",250,23)
#print(sb.hp)
def upgrade():
sb.level=sb.level+1
sb.hp=sb.hp+50
sb.attack=sb.attack+4
sb=Hero("傻逼",300,20)
print("1:",sb.hp)
upgrade()
upgrade()
print("2:",sb.hp)
\ No newline at end of file
def upgade(self):
self.level=self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
sd=Hero("傻逼",300,20)
print("1:",sd.hp)
sd.upgade()
sd.upgade()
print("2:",sd.hp)
\ 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