Commit eb11efd7 by BellCodeEditor

save project

parent c0dc5df9
Showing with 13 additions and 14 deletions
class Sb: class Sb:
def __init__(hero,name,hp,attack): def __init__(self,name,hp,attack):
hero.hp=hp self.hp=hp
name=name self.name=name
hero.level=1 self.level=1
hero.attack=attack self.attack=attack
yase=Sb("亚瑟",900,30) def upgrade(self):
print(yase.name) self.level += 1
def upgrade(): self.hp =self.hp + 150
yase.level += 1 self.attack = self.attack + 10
if yase.level==yase.level+1 yase=Sb("亚瑟",300,20)
yase.hp += 50 yase.upgrade()
yase.attack += 4 print(yase.hp)
def print(yase.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