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

Always Ran Out of Time on Backwoods Standoff A [SOLVED]

My hero Hattori seems to have enough speed,but this level always ends with “Ran out of time”
Sometimes he seems to cleave when there are too few enemies around, so he spends too much time fighting individual enemies.How do I not run out of time but still kill all the enemies

while True:
    enemy = hero.findNearestEnemy()
    # Use an if-statement with isReady to check "cleave":
    if hero.isReady("cleave") and hero.distanceTo(enemy) <10:
        # Cleave!
    # Else, if cleave is not ready:
        # Attack the nearest ogre.

Not sure what to tell you. Your code works for me. One note, you don’t have to add the hero.distanceTo(enemy). The enemies are timed out to match the cleave.

Hi Jabari! Welcome to Discourse.

Use Tharin instead of Hattori. You’ll pass with Tharin. His health multiplier is higher.

Even with Tharin I do not pass

It worked when I hit submit but not while running it before submitting it. Thank you for the help!