Processing java path finder

Sorry didn’t read whole thing or did the math. I’ll try your ideas and see if it get me what I want. TY that code was what I meant. How would I get the path to an enemy now? & also place walls in for the enemy to go around. I’ll send pic in second of what I’m asking. OK, this picture is what I’m asking in this question not the last one. The grid is in the back not seen I need it to draw the white line to the target and then tranfer that data to the enemy so he can move.path I never did understand how coding train made his avoid stuff. Here is the grid showing.The red is where the wall should be at 24 through like 45 or something like that.path2 As you can see the path just goes straight down as all the nodes are free to travel through.