Commit f504b77f by BellCodeEditor

save project

parent 184054c9
Showing with 12 additions and 11 deletions
...@@ -5,14 +5,15 @@ class Hero: ...@@ -5,14 +5,15 @@ class Hero:
self.hp = hp self.hp = hp
self.attack= attack self.attack= attack
def upgrade(): yase = Hero('亚瑟',300,20)
yase.self.level = level+1 def upgrda():
yase.self.hp = hp+50 yase.level = yase.level+1
yase.self.attack = attack+4 yase.hp = yase.hp+50
print('亚瑟的血量为:',yase.hp) yase.attack = yase.attack+4
# print('亚瑟的血量:',yase.self.hp)
def upgrade(): def upgrda():
yase.self.level = level+1 yase.level = yase.level+1
yase.self.hp = hp+50 yase.hp = yase.hp+50
yase.self.attack = attack+4 yase.attack = yase.attack+4
print('亚瑟的血量为:',yase.hp) print(yase.level,yase.hp,yase.attack)
\ No newline at end of file \ 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