OK so I have been working on this for a bit. Obviously a lot more to this, but initially I thought I had unset the “coin” at some point so I spent time debugging that. Finally I just tried the following to test if I was going crazy:
loop {
var coin = this.findNearest(this.findItems());
if (coin === null) {
this.say(“THIS FUNCTION IS BROKEN BOOOOOO!”);
break;
}
}
It never finds an item. There could be a coin right next to the dudes head, and he still won’t find it. The enemies array seems to work no problem, is the items array not allowed on this level or something?
Hoping someone else has run into this issue and found a solution.