This is a Javascript only level. When I go to this level, the level always runs out of time. There is another level with the same name in Backwoods Forest, where you can choose Python or Javascript. When I go to the Python or Javascript level in Backwoods Forest, changed to Javascript, I paste my code and it works fine. Note that this is the exact same level with the same name and character. Here’s my code.
function pickUpCoin() {
var coin = hero.findNearestItem();
if(coin) {
hero.moveXY(coin.pos.x, coin.pos.y);
}
}
function attackEnemy(){
var enemy = hero.findNearestEnemy();
if(enemy){
hero.attack(enemy);
}
}
while(true) {
attackEnemy();
pickUpCoin();
}
I pasted your code in and it completed fine. While it appears to be identical to the Forest level, my guess is that there is a subtle difference. I’m thinking it has got to be equipment based. My hero has Boots of Leaping and the Speed ring…are you using these?