{"id":13763878,"url":"https://github.com/prettymuchbryce/easystarjs","last_synced_at":"2025-05-14T06:14:33.666Z","repository":{"id":4807699,"uuid":"5961186","full_name":"prettymuchbryce/easystarjs","owner":"prettymuchbryce","description":"An asynchronous A* pathfinding API written in Javascript.","archived":false,"fork":false,"pushed_at":"2024-01-23T23:07:02.000Z","size":853,"stargazers_count":1911,"open_issues_count":36,"forks_count":168,"subscribers_count":46,"default_branch":"master","last_synced_at":"2025-05-12T12:11:17.708Z","etag":null,"topics":["astar","asynchronous","easystar","game","grid","javascript","pathfinding"],"latest_commit_sha":null,"homepage":"","language":"JavaScript","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":"MyOnlineJobs/011679","license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/prettymuchbryce.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,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2012-09-26T05:27:55.000Z","updated_at":"2025-05-08T03:39:39.000Z","dependencies_parsed_at":"2024-09-22T18:32:18.382Z","dependency_job_id":"0d8536fc-1fa1-4742-bfe8-d11b713090ff","html_url":"https://github.com/prettymuchbryce/easystarjs","commit_stats":{"total_commits":124,"total_committers":19,"mean_commits":6.526315789473684,"dds":0.5887096774193548,"last_synced_commit":"10615147add3af46f76a5d86ee7b7e7bebf83ac5"},"previous_names":[],"tags_count":20,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Feasystarjs","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Feasystarjs/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Feasystarjs/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/prettymuchbryce%2Feasystarjs/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/prettymuchbryce","download_url":"https://codeload.github.com/prettymuchbryce/easystarjs/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254083936,"owners_count":22011905,"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","asynchronous","easystar","game","grid","javascript","pathfinding"],"created_at":"2024-08-03T15:01:01.035Z","updated_at":"2025-05-14T06:14:33.636Z","avatar_url":"https://github.com/prettymuchbryce.png","language":"JavaScript","readme":"[\u003cimg src=\"http://s3.amazonaws.com/easystar/logo.png\"\u003e](http://easystarjs.com/)\n\n\n#### HTML5/Javascript Pathfinding Library #####\n\n[Click here for a demonstration](http://easystarjs.com/)\n\n## Installation\n* **Web:** Find the minified file in the __/bin__ directory\n* **node.js:** `npm install easystarjs`\n* **Phaser:** see [Phaser Plugin](https://github.com/appsbu-de/phaser_plugin_pathfinding)\n* **Bower:** `bower install easystarjs`\n\n## Description \neasystar.js is an asynchronous A* pathfinding API written in Javascript for use in your HTML5 games and interactive projects. The goal of this project is to make it easy and fast to implement performance conscious pathfinding. \n\n## Features\n\n* Calculates asynchronously for better overall performance\n* Simple API\n* Small. ~7kb\n* Use it with any existing Javascript Framework\n* TypeScript support\n\n## API\n\n#### Main Methods\n\n```javascript\nvar easystar = new EasyStar.js();\n```\n```javascript\neasystar.setGrid(twoDimensionalArray);\n```\n```javascript\neasystar.setAcceptableTiles(arrayOfAcceptableTiles);\n```\n```javascript\neasystar.findPath(startX, startY, endX, endY, callback);\n```\n```javascript\neasystar.calculate();\n```\n\n#### Additional Features\n\n```javascript\neasystar.setIterationsPerCalculation(someValue);\n```\n```javascript\neasystar.avoidAdditionalPoint(x, y);\n```\n```javascript\neasystar.enableDiagonals();\n```\n```javascript\neasystar.enableCornerCutting();\n```\n```javascript\neasystar.setAdditionalPointCost(x, y, cost);\n```\n```javascript\neasystar.setTileCost(tileType, multiplicativeCost);\n```\n```javascript\neasystar.enableSync();\n```\n```javascript\neasystar.setDirectionalCondition(x, y, [EasyStar.TOP, EasyStar.LEFT]); // only accessible from the top and left\n```\n```javascript\nvar instanceId = easystar.findPath(startX, startY, endX, endY, callback);\n// ...\neasystar.cancelPath(instanceId);\n```\n\n## Usage\n\nFirst create EasyStar.\n```javascript\n// for web\nvar easystar = new EasyStar.js();\n\n// for node.js\nvar easystarjs = require('easystarjs');\nvar easystar = new easystarjs.js();\n```\n\nCreate a grid, or tilemap. You may have made this with a level editor, or procedurally. Let's keep it simple for this example.\n```javascript\nvar grid = [[0,0,1,0,0],\n            [0,0,1,0,0],\n            [0,0,1,0,0],\n            [0,0,1,0,0],\n            [0,0,0,0,0]];\n```\n\nSet our grid.\n```javascript\t\neasystar.setGrid(grid);\n```\nSet tiles which are \"walkable\".\n```javascript\neasystar.setAcceptableTiles([0]);\n```\n\nFind a path.\n```javascript\neasystar.findPath(0, 0, 4, 0, function( path ) {\n\tif (path === null) {\n\t\talert(\"Path was not found.\");\n\t} else {\n\t\talert(\"Path was found. The first Point is \" + path[0].x + \" \" + path[0].y);\n\t}\n});\n```\n\nEasyStar will not yet start calculating my path. \n\nIn order for EasyStar to actually start calculating, I must call the calculate() method.\n\nYou should call `easystar.calculate()` on a ticker, or setInterval.\n\nIf you have a large grid, then it is possible that these calculations could slow down the browser. \nFor this reason, it might be a good idea to give EasyStar a smaller `iterationsPerCalculation` value via \n\n```javascript\neasystar.setIterationsPerCalculation(1000);\n```\n\nIt may take longer for you to find a path this way, but you won't completely halt your game trying to find one.\nThe only thing left to do now is to calculate the path.\n\n```javascript\neasystar.calculate();\n```\n\n## License\n\neasystar.js is licensed under the MIT license. You may use it for commercial use.\n\n## Running the demo locally\n\nIn order to run the demo you will need node.js, and npm installed.\n\n```sh\ngit clone https://github.com/prettymuchbryce/easystarjs.git\n\ncd easystarjs/demo\n\nnpm install\n\nnode app.js\n```\n\nOpen your browser to 127.0.0.1:3000 to see the example.\n\n## Testing\n\n`npm run test`\n\n## Support\n\nIf you have any questions, comments, or suggestions please open an issue.\n","funding_links":[],"categories":["JavaScript","Uncategorized"],"sub_categories":["Uncategorized"],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Feasystarjs","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fprettymuchbryce%2Feasystarjs","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fprettymuchbryce%2Feasystarjs/lists"}