hello I am at this level interception where profit not make my hero take the same route as the peasant this is my code.
while(true) {
var enemy = hero.findNearest(hero.findEnemies());
var friend = hero.findFriends();
// Find the point between the enemy’s position and your friend’s position.
// Check the guide if you need more help!
if(enemy){
if(friend.type == “hamming-peasant”){
var x = (enemy.pos.x + friend.x)/2;
var y = (enemy.pos.y + friend.y)/2;
hero.moveXY(x, y);
}
}
}
when placing friend.type == “peasante” I leave to get out mistake as I was saying before that is not recognized NaN x, y, y = NaN
I was told that friend is a good arrangement but I’m no expert’m learning if such an arrangement might know in what position is the peasante you have to protect my hero.
although I seem more an object