New Level: Deadly Pursuit

hello, i have being taking to the duel grand i can not defeat any one i dont even know how i get there… please . help to explain. they are all strong and also i have writing all the code i could to defeat them but they still defeat me please help

If you go to the Dueling Grounds ladder page, you should be able to click “Play as Ogres” or “Play as Humans” and then pick an easy opponent, who might be easier to beat: http://codecombat.com/play/ladder/dueling-grounds

Hello Nick, I’m stuck on this level, all ogres are trapped and all gold have being collected but it’s just saying that time is up. Attaching screen.

@Serhii_Hrabas Blow the ogres up instead of building fences. I’ll change “stop” to “destroy” in the goal text to make this a bit more clear.

Hi, i can’t go through this stage with my code.(Rich forager) i dont no why. Please help. i have a good weapon but still can’t pass all enemy.

loop:
flag = self.findFlag()
enemy = self.findNearestEnemy()
item = self.findNearestItem()
if flag:
# What happens when I find a flag?
fx = flag.pos.x
fy = flag.pos.y
self.pickUpFlag(flag)
elif enemy:
# What happens when I find an enemy?
self.attack(enemy)
self.attack(enemy)
elif item:
# <item %>
pos = item.pos
a = pos.x
b = pos.y
self.moveXY(a, b)

For Rich Forager, if you are using the long sword or other weapon with a special attack, try using your cleave/special attack to give yourself an edge on this one.

This is the code I’ve written for this level, It keeps saying that my last line of code is wrong, I’m a teacher and I have a few students asking about this, so a prompt response would be great

loop:
flag = self.findFlag()
item = self.findNearestItem()
if flag:
self.pickUpFlag(flag)
pos = self.pos
X = pos.X
Y = pos.Y
self.buildXY(“Fire-trap”, X, Y)
elif item and not flag:
itempos = item.pos
itemX = itempos.X
itemY = itempos.Y
self.moveXY(itemX, itemY)

what’s wrong with that line? is my code wrong?

the pos.X and pos.Y need to be lower case. pos.x pos.y

thanks so much, I was wondering what was wrong!

what is the difference between
var flag = this.findFlag();
and
var flag = self.findFlag();

i’m seeing this “self” in this thread.

The same code that I ran in the previous level “Drop the Flag” returns an error on this level.

loop {
var flag = this.findFlag();
if (flag) {
// How do we get fx and fy from the flag’s pos?
flagpos = flag.pos;
fx = flag.pos.x;
fy = flag.pos.y;

    this.buildXY("fire-trap", fx, fy);
    this.pickUpFlag(flag);
}
else {
    var item = this.findNearestItem();
    if (item) {
        var pos = item.pos;
        var itemX = pos.x;
        var itemY = pos.y;
        this.moveXY(itemX, itemY);
    }
}

}

it says “undefined” is not a function for this line.

this.moveXY(itemX, itemY);

It says that my moveXY(itemX, itemY) is wrong but I don’t know why.

while True:
flag = hero.findFlag()
item = hero.findNearestItem()
if flag:
flagX = flag.pos.X
flagY = flag.pos.Y
hero.buildXY(“fire-trap”, flagX, flagY)
hero.pickUpFlag(flag)
else:

    if item:
        itempos = item.pos
        itemX = itempos.X
        itemY = itempos.Y   
        hero.moveXY(itemX, itemY)

Try lowercase x and y.

itemX = itempos.x

Here is a way to determine if each will work:

hero.say("X = " + itempos.X + " x = " + itempos.x)