Git Product home page Git Product logo

Comments (3)

Irrelon avatar Irrelon commented on September 28, 2024

@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.

goldfire avatar goldfire commented on September 28, 2024

Bah, I feel like a moron. Not sure how I missed that. Thanks, works beautifully!

from ige.

Irrelon avatar Irrelon commented on September 28, 2024

@goldfire Hehe, don't worry this is all still "hidden away" documentation at the moment!

from ige.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.