Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

PathFinding - price of point does not take effect #9

Open
likexoo opened this issue Jun 2, 2021 · 0 comments
Open

PathFinding - price of point does not take effect #9

likexoo opened this issue Jun 2, 2021 · 0 comments

Comments

@likexoo
Copy link

likexoo commented Jun 2, 2021

Steps to reproduce

        float[,] tilesmap = new float[4, 4];
        for (int i = 0; i < 4; i++)
        {
            for (int ii = 0; ii < 4; ii++)
            {
                tilesmap[i, ii] = 3.0f; // <= price is 3
            }
        }

        NesScripts.Controls.PathFind.Grid grid = new NesScripts.Controls.PathFind.Grid(tilesmap);

        Point _from = new Point(0, 0);
        Point _to = new Point(3, 3);

        List<Point> path = Pathfinding.FindPath(grid, _from, _to, Pathfinding.DistanceType.Manhattan);

        foreach (Point p in path)
        {
            Debug.Log(p.x + " , " + p.y);
        }

        // path: (1,0) (1,1) (2,1) (2,2) (3,2) (3,3)

Expected result

According to my understanding, path should be:

(1,0) (1,0) (1,0) (1,1) (1,1) (1,1) (2,1) (2,1) (2,1) (2,2) (2,2) (2,2) (3,2) (3,2) (3,2) (3,3) (3,3) (3,3)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant