hey there im new to code combat, smashing through the levels and ive hit a brick wall and cant work out what im doing wrong. its in regards to tagerting enemies…i put up this simple code that ive used loads but now it work work:
loop:
enemy = self.findEnemies()
if enemy:
if self.isReady("cleave") and self.distanceTo(enemy) < 5:
self.cleave(enemy)
else:
self.attack(enemy)
i just want to target and attack enemis but it keeps coming up with “fix code: find distance to target unit” if tried replacing self.distanceTo(enemy.pos) and that doesnt work either. help! the level im on is sarven treasure btw and im using python.