Bouder woods please help[python]


#1
while True:
    angle = Math.PI / 2 - Math.PI / 16
    while angle >= -Math.PI / 2:
        targetX = hero.pos.x + 5 * Math.cos(angle)
        targetY = hero.pos.y + 5 * Math.sin(angle)
        if hero.isPathClear(targetX, tragetY):
            hero.move({'x': targetX, 'y': targetY})
            angle -= Math.PI / 16
        else:
            hero.move({'x': hero.pos.x, 'y': hero.pos.y})

i dont know what my problem is but my hero just stays in one spot


#2
  1. Use isPathClear between your current pos and the target.
    What is your current pos?
    What is the target?

  2. Otherwise, sweep the angle clockwise a bit.


#3

wait what sorry was working on another level im stuck on


#4

am i using isPathClear() wrong because thats what its saying when i try to do the level


#5

IsPathClear is used to find if there are any hazards from point a to point b.

Something like: isPathClear(hero.pos, item.pos).

You find if there are traps from your location to the item’s location