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

[SOLVED] Bash 'Em All - speed problem

while True:
    enemy = hero.findNearestEnemy()
    if enemy:
    item = hero.findNearestItem()
    if item:
        hero.moveXY(item.pos.x, item.pos.y)

I got an issue here, hero runs, bashes the ogre, the dude goes flying above and beyond the minefield, (without exploding the field). Hero then targets the gems and goes towards it, exploding the mine field, sending our unfortunate hero in orbit…


Hi Giannis.
The problem is you’re running towards the item too soon after bashing the enemy.
Think about what would happen if you just let the enemy run towards you from behind the minefield? (When you were a safe distance away of course)
I hope this helps.
:lion: :lion: :lion:


hey, thanks for the reply DP,
im messing around with the distance option still trying to make it work,
somewhere i read there is a hero.wait or some command like that, is that something vaild? havent come across it


The hero.wait() method is available with certain wristwatches. An upgrade to your equipment can get you that ability.


This is the one…


You can pass the level with the absolutely minimal equipment. No books, no glasses, only Crude Spike shield and Sundial Wristwatch I think is obligatory with hero.isReady(“bash”)


Thanks for all the helpful posts, they were indeed what i needed to finish the level.