Commit b243764c by BellCodeEditor

save project

parent 3f336258
Showing with 6 additions and 6 deletions
......@@ -5,11 +5,11 @@ class Hero:
self.hp= hp
self.attack= attack
def upgeade(self):
self.level = self.level+1
self.level=self.level+1
self.hp = self.hp+50
self.attack = self.attack+4
yase = Hero("垭塞",300,20)
print("当前血量为:",self.hp)
upgeade()
upgeade()
print("当前血量为:",self.hp)
\ No newline at end of file
yase.upgrade()
print("当前等级为:",yase.level)
print("当前血量为:",yase.hp)
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