{"id":14964030,"url":"https://github.com/raresail/phaser-pathfinding","last_synced_at":"2025-04-03T20:30:25.127Z","repository":{"id":200397077,"uuid":"705631861","full_name":"RaresAil/phaser-pathfinding","owner":"RaresAil","description":"A phaser3 pathfinding algorithm using heap data structure","archived":false,"fork":false,"pushed_at":"2023-10-23T08:02:30.000Z","size":1611,"stargazers_count":2,"open_issues_count":0,"forks_count":1,"subscribers_count":1,"default_branch":"master","last_synced_at":"2024-10-17T17:39:42.436Z","etag":null,"topics":["astar-algorithm","heap","heap-data-structure","navigation","pathfinding","phaser-game","phaser-plugin","phaser3","phaserjs","tilemap","tiles","typescript"],"latest_commit_sha":null,"homepage":"https://raresail.github.io/phaser-pathfinding/","language":"TypeScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/RaresAil.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2023-10-16T11:52:38.000Z","updated_at":"2024-03-29T09:10:53.000Z","dependencies_parsed_at":null,"dependency_job_id":"9a7ec4d7-f0c1-47e1-a5ad-e431b0c99844","html_url":"https://github.com/RaresAil/phaser-pathfinding","commit_stats":null,"previous_names":["raresail/phaser-pathfinding"],"tags_count":6,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fphaser-pathfinding","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fphaser-pathfinding/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fphaser-pathfinding/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/RaresAil%2Fphaser-pathfinding/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/RaresAil","download_url":"https://codeload.github.com/RaresAil/phaser-pathfinding/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":223027720,"owners_count":17076033,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["astar-algorithm","heap","heap-data-structure","navigation","pathfinding","phaser-game","phaser-plugin","phaser3","phaserjs","tilemap","tiles","typescript"],"created_at":"2024-09-24T13:32:29.765Z","updated_at":"2024-11-04T16:21:46.797Z","avatar_url":"https://github.com/RaresAil.png","language":"TypeScript","readme":"# @raresail/phaser-pathfinding\n\nA phaser pathfinding algorithm using heap data structure\n\n[Documentation](https://raresail.github.io/phaser-pathfinding/)\n[Type Definitions](https://raresail.github.io/phaser-pathfinding/module-PhaserPathfinding.html)\n\n## Documentation\n\nFor a complete documentation on how to change the distance method used in calculating the path or simplification of the path, check the above link, supported distance methods at this moment:\n\n| Method    | Description                                                                                                                                                                                                                            |\n| --------- | -------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------- |\n| Octile    | (Recommended) Is a variant of Chebyshev distance used when movement is allowed along diagonals in addition to horizontal and vertical directions, but diagonal movement has a cost of √2 times that of horizontal or vertical movement |\n| Chebyshev | It is a distance metric defined on a vector space where the distance between two vectors is the greatest of their differences along any coordinate dimension                                                                           |\n| Manhattan | It is a distance metric between two points in an N-dimensional vector space. _**When set to this method, and if the diagonal is disabled, the path won't include zig zag moves**_                                                      |\n|           |                                                                                                                                                                                                                                        |\n\n## Installation\n\n```bash\nyarn add @raresail/phaser-pathfinding\n```\n\n## Usage\n\n```ts\n// Create a grid from the existing tilemap and specify the layers that are obstacles, in the current case the water layer is not walkable\nconst grid = Grid.createFromMap(map, [waterLayer]);\n\n// The pathfinding instance is created from the grid and is used to get the path between 2 vectors on the map\nconst pathfinding = new Pathfinding(grid);\n\n// The tl method is used for tile units and the `findPathBetweenPx` method is used to find the path based on pixels\nconst path = this.pathfinding.findPathBetweenTl(\n  new Phaser.Math.Vector2(0, 0),\n  new Phaser.Math.Vector2(10, 10)\n);\n\n// The path variable will be an array of nodes that can be used to move the \"enemy\" let's say towards the target\n// The props worldX and worldY contains the position in pixels for that specific node\nconsole.log(path[0].worldX, path[0].worldY);\n```\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraresail%2Fphaser-pathfinding","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fraresail%2Fphaser-pathfinding","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fraresail%2Fphaser-pathfinding/lists"}