Commit 3f8aa282 by BellCodeEditor

save project

parent 821a586a
Showing with 4 additions and 2 deletions
class Hero: class Hero:
def __init__(self,level,hp,attack): def __init__(self,name,level,hp,attack):
self.name=name
self.level=level self.level=level
self.hp=hp self.hp=hp
self.attack=attack self.attack=attack
...@@ -7,7 +8,8 @@ class Hero: ...@@ -7,7 +8,8 @@ class Hero:
self.level=self.level+1 self.level=self.level+1
self.hp=self.hp+50 self.hp=self.hp+50
self.attack=self.attack+4 self.attack=self.attack+4
yase=(1,300,20) yase=Hero("亚瑟",1,300,20)
yase.upgrade() yase.upgrade()
print(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