I can’t pass this level. please check and correct code. give me nice advice.
here is my coding
// 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”:
else if (enemy.type == “brawler”) {
hero.moveXY(30, 34);
// Then say something to call the brawler:
hero.say(“hey! come on silly brawler!”);
}
while (true) {
if (enemy) {
dealEnemy(enemy);
} else {
hero.moveXY(30, 34);
}
}
}
Hello and welcome to codecombat discourse! This is a cozy forum where you can share ideas, share fan art, get assistance for code, etc! Before you proceed, we hope that you review this topic, which shows all essentials of this board! Thanks!