Commit b19b70a4 by BellCodeEditor

save project

parent 29ec9c24
Showing with 10 additions and 14 deletions
...@@ -5,16 +5,12 @@ class Hero: ...@@ -5,16 +5,12 @@ class Hero:
self.hp = hp self.hp = hp
self.attack = attack self.attack = attack
aqi = Hero("阿七",300,20) def upgrade(self):
killer7 = Hero("柒",250,25) self.level=self.level+1
#print("亚瑟的血量:",yase.hp) self.hp=self.hp+10
#print("亚瑟的等级:",yase.level) self.attack=self.attack+5
#print("亚瑟的攻击力:",yase.attack) houyi= Hero("阿七",300,20)
def killer(): houyi.upgrade()
self.level=self.level+1 print("等级为:",houyi.level)
seif.hp=self.hp+10 print("血量为:",houyi.hp)
seif.attack=self.attack+5 print("攻击力为:",houyi.attack)
aqi.killer() \ No newline at end of file
print("等级为:",aqi.level)
print("血量为:",aqi.hp)
print("攻击力为:",aqi.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