Please help! This is my script so far:
loop:
enemy = self.findNearestEnemy()
distance = self.distanceTo(enemy.pos)
if distance < 10:
# Attack if they get too close to the peasant.
self.attack(enemy)
else:
self.move({"x":40, "y":37})
# Else, stay close to the peasant! Use else.
But when I run it, I move, but I don’t attack. Also, 1 more thing: for the “if distance < 10:” part, it won’t work at 10, it only works at 20. Is this a glitch or did I do something wrong?