#Effective Loop Instantiation

1 messages ยท Page 1 of 1 (latest)

rare stratus
#

Hi All,
I am trying to implement vector flow field pathfinding in plane.

So far, I've achieved a grid effect and two-dimensional array which holds the information for each Cell, such as X Position, Y Postion, Column, Row, Type etc.

As per the article(https://www.redblobgames.com/pathfinding/tower-defense), and Vector flow field pathfinding also known as goal based pathfinding, is all source all target algorithm. So every node points to the nearest small node and the process repeats till the target with value 0 is achieved.

Problem :
I am able to get the immediate next neighbors of the green end point but I am unable to move forward, any clue around this, how can I implement a for loop for all 4 direction(Top, Right, Bottom & Left).

Any help is appriciated.
๐Ÿ†˜

jolly oreBOT
#

<@&987246399047479336> please have a look, thanks.

rare stratus
#

As always, this discord channel never disappoints me to find my answers on my OWN. Lol. ๐Ÿ˜„

#

Incase if anyone is interested in solution -
Converted two dimensional array in single arraylist. And then ran the(attached code snippet)