// Move in sync with your dance partner to impress Pender Spellbane.
var friend = hero.findNearest(hero.findFriends());
if (friend) {
var ydistance = friend.pos.x - hero.pos.x;
while (true) {
var x = hero.pos.x;
var y = hero.pos.y;
var yy = friend.pos.y - hero.pos.y;
if (hero.pos.x != friend.pos.x) {
hero.move({x: friend.pos.x, y: y});
}
if (yy != 7) {
if (yy == 8) {
hero.move({x: x, y: y + 1});
} else if (yy == 6) {
hero.move({x: x, y: y - 1});
}
}
}
}```
My hero doesn't move up and down the y-axis.
Hey @BMoney could you post a screenshot of what happens when you run your code such as any erros and etc. Also thanks for properly formatting your code!