Commit 47063274 by BellCodeEditor

save project

parent 458a20f4
Showing with 6 additions and 8 deletions
class Hero:
def __init__(self,name,hp,attack):
self.name=name
self.leve=1
self.level=1
self.hp=hp
self.attack=attack
def upgrade(self):
self.level= self.level+1
self.hp=self.hp+50
self.attack=self.attack+4
yase=Hero("yase",300,20)
houyi=Hero("houyi",250,23)
def upgrade(self):
self.leve= self.leve+1
self.hp.self.hp+50
self.attack=self.attack+4
upgrade(yase)
upgrade(houyi)
yase.upgrade(yase)
print("yase的血量为"+str(yase.hp))
......
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