so I havent done this level before but for the x shouldnt you add
x= (hero.pos.x+friend.pos.x)/2
to
x= (friend.pos.x+enemy.pos.x)/2
so @bladee change the hero.pos.x to friend.pos.x and the friend.pos.x to enemy.pos.x
so I havent done this level before but for the x shouldnt you add
x= (hero.pos.x+friend.pos.x)/2
to
x= (friend.pos.x+enemy.pos.x)/2
so @bladee change the hero.pos.x to friend.pos.x and the friend.pos.x to enemy.pos.x