[SOLVED ]Issues with Taunting level in Backwoods forest

I’m playing the level with the brawlers you have to lead into the mines and I can only get one of the three to walk over into them. Can someone read over my code and read what’s wrong? thank you!

Hmmm, we have almost the exact same code and my result is success… the only thing different in mine is that I use let and not var, try that, because var behaves weirdly sometimes…

Ok, if this helps show my code easier here is this

// Attack munchkins, call brawlers and ignore burls.

// This function defines the hero's behaviour about enemies.
function dealEnemy(enemy) {
    // If enemy.type is "munchkin":
    if (enemy.type == "munchkin") {
      
    
        // Then attack it:
        hero.attack(enemy);
    }    
    // If the enemy's type is "brawler":
    if (enemy.type == "brawler") {
     
        
    
        // Then say something to call the brawler:
         hero.say("hey you");
    }
}

while (true) {
    var enemy = hero.findNearestEnemy();
    if (enemy) {
        dealEnemy(enemy);
    }
    else {
        hero.moveXY(30, 34);
    }
}

Yeah, it’s almost the exact same, just keep submitting until it works I guess

<iframe src="https://drive.google.com/file/d/1rnr57cbirk8mf4ioGx9v3m9HauDYMEBN/preview" width="640" height="480"></iframe>

It’s working now idk what was wrong…

could you please mark whichever post helped the most as solved? that way no one can reply to it and it becomes locked.

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.