Hi, I was triyng for few days this level in the the forest. The problem is that in the middle of tha dventure my character does not move at all. I need a solutoin. I had been used this code:
loop {
var enemy = this.findNearestEnemy();
var item = this.findNearestItem();
var flag = this.findFlag("green");
if (item){
if (enemy){
if (this.isReady("cleave")){
this.cleave(enemy);
}
else {
this.attack(enemy);
}
}
else {
var ItemPos = item.pos;
var Ix = ItemPos.x;
var Iy = ItemPos.y;
this.moveXY(Ix, Iy);
}
}
}
no item == no action . . . bummer dude. (depending on the glasses can you see far enough??)
There will come a time when you won’t do anything (but fight) since the only coins will be in other sections of the map and you won’t be able to see them (unless you have the see through walls glasses) so you will have to decide to walk out of your current section into another.
OK, thank you to everyone. the problem was that I could see far enough for get the rest of the coin. So what I did?
"if(!item){
move to the center}
"
Thank you so much.