[SOLVED]Need Help on drop the flag

My bad, write hero.buildXY("fire-trap", flag.pos.x, flag.pos.y) right BEFORE the hero.pickUpFlag().

Basically add hero.buildXY("fire-trap", flag.pos.x, flag.pos.y) where I marked it

# Put flags where you want to build traps.
# When you're not building traps, pick up coins!

while True:
    flag = hero.findFlag()
    if flag:
        # How do we get flagX and flagY from the flag's pos?
        # (Look below at how to get x and y from items.)
        ("fire-trap", flag.pos.x, flag.pos.y)
        hero.pickUpFlag(flag)
    else:
        item = hero.findNearestItem()
        if item:
            itemPos = item.pos
            itemX = itemPos.x
            itemY = itemPos.y
            hero.moveXY(itemX, itemY)

this is my code so far

it should be
hero.buildXY("fire-trap", flag.pos.x, flag.pos.y)
not
(ā€œfire-trapā€, flag.pos.x, flag.pos.y)
@calvin you have to add the hero.buildXY()
then put your flags on the x where the ogres are coming
this should work

1 Like

I MISSED MY ZOOM :frowning:

You missed your class?

IT WAS 10 MINS AGO :open_mouth:

So did it end or are you lateā€¦

its still on i just joined

1 Like

Okay, good thing you didnā€™t miss it.

i gtg :frowning: :frowning:

1 Like

This topic was automatically closed 12 hours after the last reply. New replies are no longer allowed.