Commit b19b70a4 by BellCodeEditor

save project

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