I am working on the level Medical Attention but something has come up. In the beginning of the scene I get healed but then not once again. Here is my code:
loop:
currentHealth = self.health
healingThreshold = self.maxHealth / 2
enemy = self.findNearestEnemy()
if currentHealth < 100:
if self.distanceTo(enemy) > 20:
self.moveXY(65, 46)
self.say("heal me")
else:
if enemy:
if self.isReady("cleave"):
if self.distanceTo(enemy) < 6:
self.cleave(enemy)
else:
self.attack(enemy)
else:
self.attack(enemy)
else:
self.moveXY(45, 34)
I’m no sure where I’ve messed up so any help is appriciated thanks