Comments (3)
@goldfire In the path-finding example (9.5) the middle tile is "blocked" so the entity should not path through it. You can set the square and diagonal movement options of the path-finder via the options passed to the aStar() method as documented in the IgePathFinder.js file:
/**
* Uses the A* algorithm to generate path data between two points.
* @param {IgeCollisionMap2d} tileMap The tile map to use when generating the path.
* @param {IgePoint} startPoint The point on the map to start path-finding from.
* @param {IgePoint} endPoint The point on the map to try to path-find to.
* @param {Function} comparisonCallback The callback function that will decide if each tile that is being considered for use in the path is allowed or not based on the tile map's data stored for that tile which is passed to this method as the first parameter. Must return a boolean value.
* @param {Boolean} allowSquare Whether to allow neighboring tiles along a square axis. Defaults to true if undefined.
* @param {Boolean} allowDiagonal Whether to allow neighboring tiles along a diagonal axis. Defaults to false if undefined.
* @return {Array} An array of objects each containing an x, y co-ordinate that describes the path from the starting point to the end point in order.
*/
aStar: function (tileMap, startPoint, endPoint, comparisonCallback, allowSquare, allowDiagonal) {
from ige.
Bah, I feel like a moron. Not sure how I missed that. Thanks, works beautifully!
from ige.
@goldfire Hehe, don't worry this is all still "hidden away" documentation at the moment!
from ige.
Related Issues (20)
- _three undefined HOT 2
- New Documentation System HOT 3
- 'CanvasRenderingContext2D.webkitImageSmoothingEnabled' is deprecated. Please use 'CanvasRenderingContext2D.imageSmoothingEnabled' instead. game.js:10 HOT 2
- Changes to Canvas Rendering HOT 4
- Show Stats depreciation HOT 3
- Mongo Connection variables HOT 3
- IgeUiTextBox DOM equivalent not being properly disposed HOT 2
- IE Edge IgeDontSheet JSON parse error HOT 3
- tileToPoint gives incorrect data HOT 1
- font-based UI labels don't work HOT 6
- moderation not happening on forum HOT 24
- Changing speed on an active path causes entity to suddenly skip forwards/backwards HOT 3
- Mouseover/out events do not trigger properly from composite cached entities HOT 2
- IGE-ES6 - Default behavior of _resizeEvent on IgeObject causes performance hit HOT 2
- Active development HOT 2
- Safari: total canvas memory use exceeds the maximum limit (256 mb) HOT 2
- IGE-ES6 - Composite caching no longer works HOT 5
- IGE-ES6 - Using the engine as a module\project reference is broken by recent change HOT 4
- Is es6-typescript branch ready for testing? HOT 1
- How to detect collision on IgeCannon...? HOT 2
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from ige.