Play Home Contribute Github Join Us! Discourse Staff Members Github Contribution Guides Team

I need help on woodland leaver

@ducky @JavaScriptNinja @mr_javascript
i am stuck this level and here is my code

// Use your new "cleave" skill as often as you can.
hero.moveXY(23, 29);
while(true) {
    var enemy = hero.findNearestEnemy();
    if (hero.isReady("cleave")) {
        // Cleave the enemy!
        var enemy = hero.findNearestEnemy();
    var enemy = hero.findNearestEnemy();
        if (enemy) 
         hero.cleave(enemy);
         hero.shield();
         var enemy = hero.findNearestEnemy();
         hero.attack(enemy);
         hero.shield();
        var enemy = hero.findNearestEnemy();
         hero.cleave(enemy);
         while(true) {
    var enemy = hero.findNearestEnemy();
    hero.shield();
    
    hero.cleave(enemy);
    hero.shield();
    hero.shield();
    hero.moveXY(42, 12);
    hero.cleave(enemy);
    hero.shield();
    hero.cleave(enemy);
}

}}

Every time you post, you need to explain your problem. It saves us all time.

my problem for this level is that i can’t get cleave to work when i say
hero.cleave(enemy)

Well, think. Is cleave ready every time that you use it? Isn’t there a cooldown?

yes i think so

[en_US.composer.my_button_text]

Then try if hero.isready();

@ducky
how do i start a clan war too

Clan Wars aren’t currently a feature in CodeCombat, sorry.