RafaelBarbosatec / a_star

Package that uses the A * algorithm to find a way to the destination through the barriers.
MIT License
17 stars 10 forks source link

Update a_star_algorithm.dart #8

Closed Horned-Nonsense closed 6 months ago

Horned-Nonsense commented 6 months ago

If we check only one coordinate, then a problem may arise when, for example, start(1,2) is considered a neighbor of end(2,5). After all, they are adjacent along the X coordinate, even despite the large distance along the Y coordinate. The changes also take into account diagonal proximity checks.

RafaelBarbosatec commented 6 months ago

LGTM! Thanks for contributing!