// Get to the Oasis by moving down 10m at a time.
// Build fences 20m to the left of each ogre.
while(true) {
var enemy = hero.findNearestEnemy();
if (enemy) {
// buildXY a "fence" 20 meters to enemy's left.
hero.buildXY("fence", enemy.pos.x - 20, enemy.pos.y);
} else {
// moveXY down 10 meters.
var x = hero.pos.x;
var y = hero.pos.y;
y -= 10;
hero.moveXY(x, y);
}
}
I am not sure what I have done wrong with the code. I put the first fence up and then when I move down it is just half way to the next opening and then is stuck and says that they can’t get there. I have tried a few things but nothing has worked. Any ideas would be awesome.
Thanks
Rinlore