Return to thornbush farm
Every time i run the code it see friendly’s as enemy’s as enemy’s i even programed it to see friendly but it said that 1 friendly was a enemy, please help!
The function maybeBuildTrap defines TWO parameters!
def maybeBuildTrap(x, y):
# Use x and y as the coordinates to move to.
enemy = hero.findNearestEnemy()
friend = hero.findNearestFriend()
# Use buildXY to build a “fire-trap” at the given x and y.
hero.buildXY(“fire-trap”, 36, 30)
# This calls maybeBuildTrap, with the coordinates of the top entrance.
# Now use maybeBuildTrap at the left entrance!
# Now use maybeBuildTrap at the bottom entrance!