I need help on level "Stranded in the Dunes"


#1

I tried a lot of stuff but it did not work!!!:slight_smile::ribbon:


#2

What is your code? More importantly what did not work. What do you want suggestions or guidance in?


#3

// Go to the far right edge of the level to find new areas.
// Check the guide for more details.
loop {
var enemy = this.findNearest(this.findEnemies());
var flag = this.findFlag(โ€œgreenโ€);

if (flag) {
this.pickUpFlag(flag);
}
if(enemy) {
    var distance = this.distanceTo(enemy);        
    if (distance < 5){ 
         if (this.isReady("cleave")) {
            this.cleave(enemy);
         } else if (this.isReady("bash")) {
            this.bash(enemy);
         } else {
            //this.shield();        
            this.attack(enemy);
        }
    }
}

}

I donยดt know what is wrong in the code


#4

Is the code giving a syntax error or simply not functioning as expected. If it happens to be your attacking I can see one potential problem. Your hero will only attack enemies if they are within 5m any where. It may be better to set up an if (distance < 5) for bash and cleave while adding outside of the if statement your normal attack: this.attack(enemy)
I neither have access to the level in question or your programming language. My apologies.
-Cheers!