I cannot get past kelvitaph crusader

This is my code. My friends always go straight to the walls.

def commandFriends():
    for friend in hero.findFriends():
        hero.command(friend, "move", {'x': 27, 'y':57})
        hero.command(friend, "move", {'x': 58, 'y':57})
        hero.command(friend, "move", {'x': 78, 'y':40})
while True:
    commandFriends()
    enemy = hero.findNearestEnemy()
    flag = hero.findFlag("green")
    if flag:
        hero.blink(flag.pos)
        hero.pickUpFlag(flag)
    if enemy:
        if hero.isReady("shadow-vortex"):
            hero.shadowVortex(hero.pos, enemy.pos)
        else:
            hero.scattershot(enemy)`Preformatted text`

I indented where I needed to

Welcome to the forum!! please press this button </>to format your code

Welcome @Santiago_Waki :partying_face: :partying_face: :partying_face:

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!

I beleive you should command them to atttack

Though I thought that the catapults were the most chalanging to take out you could do it your way but for me I created a variable for the catapults and then shadow vortexed them

My shadow vortex takes out all the enemies, including the fireballs and the catapults.

1 Like

Ok then just command your friends to attack then and if enemy.health < 0 command them to move

shouldn’t that be

if enemy.health > 0:

no or else they would move when the enemy is still alive

1 Like

this “<” is less then so that would make them attack ogres when the health is lower then 0

I said and if the next.health < 0 move

um… can you explain it???

So basicly you are traped in a room with brawlers and catapults. youo have to kill the brawlers and the catapults your friends are traped in a different room with a ogre a witch and some other stuff you need them to escape the room. So what I mean is you want your friends to attck the enemy first. if the enemy health is smaller than zero otherwise dead command them to move to the pos they need to go.

What if the enemy’s health is zero? You should use a less than or equal to sign.