I don’t know why it did not work on this one.
while True:
enemy = hero.findNearestEnemy()
if enemy:
isLeft = hero.pos.x > enemy.pos.x
isAbove = hero.pos.y < enemy.pos.y
isRight = hero.pos.x < enemy.pos.x
isBelow = hero.pos.y > enemy.pos.y
if isLeft and isAbove:
hero.buildXY(“fire-trap”, 40 - 20, 34 + 17)
if isRight and isAbove:
hero.buildXY("fire-trap", 40 + 20, 34 + 17)
if isLeft and isBelow:
hero.buildXY("fire-trap", 40 - 20, 34 - 17)
if isRight and isBelow:
hero.buildXY("fire-trap", 40 + 20, 34 - 17)
else:
hero.moveXY(40, 34)
hero.wait(0.2)