! need help (backwood forest)![SOLVED]

Apperently, my code doesnt seem to be right.
Can somebody help ?

 function ambushAttack(target) {
    //  Attack the target if it exists and return to the mark.
    // Write the function:
     if (ogre) {
        hero.attack(ogre);
    }
    else {
        hero.moveXY(52, 36);
    }
}

while(true) {
    var ogre = hero.findNearestEnemy();
    ambushAttack(ogre);
}

Why does it go TO the Tomb instead of going back to the red Mark ?

WHat level is it???

1 Like

Is it a subscriber level?

It is the level Mail Interceptor

@enPointe77 yes it is

1 Like

Oh, I can’t look at my code then cause I don’t have one.

@enPointe77 Oh, no Problem. Thanks Anyway.

1 Like

Is it subscriber???

@thebagel Also here is a Screenshot if you need it.

@thebagel yes

#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#

Oh sorry, then I can’t help so sorry i am non sub

But I still might be able to help, what is the goal?

Ok. No problem

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!

The goal is to defeat all the ogre messengers

Ok. and the messengers are the 4 on the left right

No actually. Wait, im going to send a pic of the messengers

Ok. and I don’t think anything is wrong with your code though.

And what is the problem. like are you dying or…?

Here they are :


Yes im going and fighting the ogres instead of going back to the red Mark