1- AStar-Typescript
2- ==============
1+ # AStar-Typescript
2+
33[ ![ GitHub Stars] ( https://img.shields.io/david/digitsensitive/astar-typescript?style=flat-square )] ( https://david-dm.org/digitsensitive/astar-typescript )
44[ ![ GitHub Stars] ( https://img.shields.io/github/stars/digitsensitive/astar-typescript?style=flat-square )] ( https://github.com/digitsensitive/astar-typescript/stargazers ) [ ![ GitHub Forks] ( https://img.shields.io/github/forks/digitsensitive/astar-typescript?style=flat-square )] ( https://github.com/digitsensitive/astar-typescript/network/members ) [ ![ GitHub Issues] ( https://img.shields.io/github/issues/digitsensitive/astar-typescript?style=flat-square )] ( https://github.com/digitsensitive/astar-typescript/issues ) [ ![ Current Version] ( https://img.shields.io/npm/v/astar-typescript?style=flat-square )] ( https://www.npmjs.com/package/astar-typescript )
55
66<p align =" center " >
77 <img width =100% src =" astar_logo.png " >
88</p >
99
10- #### The A* search algorithm library in TypeScript
10+ #### The A-star search algorithm library in TypeScript
1111
12- AStar-TypeScript is an A* pathfinding API written in TypeScript to use for your HTML5 games or other browser-based projects.
12+ AStar-TypeScript is an A-star pathfinding API written in TypeScript to use for your HTML5 games or other browser-based projects.
1313
1414This library was influenced and inspired by [ @qioa - PathFinding.js] ( https://github.com/qiao/PathFinding.js ) , [ @bgrins - javascript-astar] ( https://github.com/bgrins/javascript-astar ) , [ @prettymuchbryce - easystarjs] ( https://github.com/prettymuchbryce/easystarjs ) and [ @redblobgames ] ( https://www.redblobgames.com/pathfinding/a-star/introduction.html ) .
1515
@@ -56,19 +56,19 @@ bower install astar-typescript --save
5656### TypeScript
5757
5858``` typescript
59- import { AStarFinder } from " astar-typescript" ;
59+ import { AStarFinder } from ' astar-typescript' ;
6060```
6161
6262### Javascript
6363
6464``` javascript
65- let AStarFinder = require (" astar-typescript" );
65+ let AStarFinder = require (' astar-typescript' );
6666```
6767
6868### AMD
6969
7070``` javascript
71- define (function (require ,exports ,module ){
71+ define (function (require , exports , module ) {
7272 let AStarFinder = require (' astar-typescript' );
7373});
7474```
@@ -84,10 +84,11 @@ private aStarInstance: AStarFinder;
8484Load grid data:
8585
8686Using an ** array** (hardcoded or from a Tilemap-Editor)
87+
8788> 0 = walkable
8889> 1 = not walkable
8990
90- ``` ts
91+ ``` ts
9192let myMatrix = [
9293 [0 , 0 , 0 , 0 , 0 , 0 , 0 , 0 ],
9394 [0 , 0 , 0 , 0 , 0 , 0 , 0 , 1 ],
@@ -108,7 +109,7 @@ this.aStarInstance = new AStarFinder({
108109
109110or randomly generated array ** from width and height**
110111
111- ``` ts
112+ ``` ts
112113this .aStarInstance = new AStarFinder ({
113114 grid: {
114115 width: 8 ,
@@ -132,7 +133,7 @@ Additional parameters may be passed to adapt your finder.
132133
133134If you want to disable ` diagonal movements ` :
134135
135- ``` ts
136+ ``` ts
136137this .aStarInstance = new AStarFinder ({
137138 grid: {
138139 width: 8 ,
@@ -144,13 +145,13 @@ this.aStarInstance = new AStarFinder({
144145
145146Set the ` heuristic function ` (Manhattan, Euclidean, Chebyshev or Octile):
146147
147- ``` ts
148+ ``` ts
148149this .aStarInstance = new AStarFinder ({
149150 grid: {
150151 width: 8 ,
151152 height: 8
152153 },
153- heuristicFunction: " Manhattan"
154+ heuristicFunction: ' Manhattan'
154155});
155156```
156157
@@ -161,7 +162,7 @@ Depending on the `weight` value you can decide if you prefer speed or accuracy.
161162The lower the ` weight ` is, the lower will the heuristic function get, which will
162163make the A* slower.
163164
164- ``` ts
165+ ``` ts
165166this .aStarInstance = new AStarFinder ({
166167 grid: {
167168 width: 8 ,
@@ -173,7 +174,7 @@ this.aStarInstance = new AStarFinder({
173174
174175Include or Exclude the ` start and end node ` :
175176
176- ``` ts
177+ ``` ts
177178this .aStarInstance = new AStarFinder ({
178179 grid: {
179180 width: 8 ,
@@ -190,27 +191,26 @@ This library uses [Prettier](https://github.com/prettier/prettier).
190191The configuration used can be seen in the ` .prettierrc ` file.
191192More informations about the format options can be found [ here] ( https://prettier.io/docs/en/options.html ) .
192193
193-
194194## License
195195
196196[ MIT License] ( https://opensource.org/licenses/mit-license.php )
197197
198198Copyright (c) 2017 - 2020 digitsensitive <digit.sensitivee@gmail.com >
199199
200200Permission is hereby granted, free of charge, to any person obtaining a copy
201- of this software and associated documentation files (the "Software"), to deal
202- in the Software without restriction, including without limitation the rights
203- to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
204- copies of the Software, and to permit persons to whom the Software is
201+ of this software and associated documentation files (the "Software"), to deal
202+ in the Software without restriction, including without limitation the rights
203+ to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
204+ copies of the Software, and to permit persons to whom the Software is
205205furnished to do so, subject to the following conditions:
206206
207207The above copyright notice and this permission notice shall be included in all
208- copies or substantial portions of the Software.
208+ copies or substantial portions of the Software.
209209
210210THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
211211IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
212212FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
213213AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
214214LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
215215OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
216- SOFTWARE.
216+ SOFTWARE.
0 commit comments