[SOLVED] Return to Thornbush farm help please?


I don’t know what I am doing wrong but whenever my hero builds he gets on the other side not able to build anymore… why is this?

your suppose to build fire-traps not fences

3 Likes

Thanks a lot @Eric_Tang

can someone help me my code isn’t working

def maybeBuildTrap(x, y):
    # Use x and y as the coordinates to move to.
    hero.moveXY(x, y)
    enemy = hero.findNearestEnemy()
    if enemy:
        pass
        # Use buildXY to build a "fire-trap" at the given x and y.
        hero.buildXY("fire-trap", y,x )
while True:
    # This calls maybeBuildTrap, with the coordinates of the top entrance.
    maybeBuildTrap(43, 50)
    
    # Now use maybeBuildTrap at the left entrance!
    hero.buildXY("fire-trap", 36, 30)
    # Now use maybeBuildTrap at the bottom entrance!
    hero.buildXY("fire-trap", 36, 30)
    

Your coordinates are wrong.

Not only that but it should also be maybeBuldTrap(x, y)

Woah watch your language and please dont revive dead topics.

1 Like

You make your comments sound so harsh. Be a little nicer would ya.

Welcome and please don’t revive dead topics unless you need help

2 Likes