ironicnet Posted August 7, 2013 Share Posted August 7, 2013 Hi guys! I'm testing phaser for a small game that i'm doing. I noticed that there is no pathfinding implemented in phaser. Which libraries are you using for this? I've used "Pathfinding.js" in the past, but it requires a matrix grid. The data property in the tilemaps of phaser are stored in a single array, instead of a matrix.So using this library requires me to keep replicating the changes in the tilemap data property into a matrix. How can achieve this more easily? Link to comment Share on other sites More sharing options...
Chris Posted August 7, 2013 Share Posted August 7, 2013 Why would you need to replicate?Your pathfinding algorithm can work just as well with the array, since you still have map boundaries (width and height). Just calculate the array index of a certain field x/y, then pull that value from the array to analyze it in your A* algorithm. Link to comment Share on other sites More sharing options...
ironicnet Posted August 8, 2013 Author Share Posted August 8, 2013 My bad, i didn't know that the TileMap had the map data property... This is the code... I don't know why but isn't working in plunkr:http://plnkr.co/edit/o8pREIzUISFqIJMjTd7l Thanks for the help! BTW, is there any documentation or anything? I'm using console.log and the sources to see the features.. (besides the example page) Link to comment Share on other sites More sharing options...
rich Posted August 8, 2013 Share Posted August 8, 2013 Sorry I've no idea why it doesn't work on plunkr, maybe something to do with the paths to the files? Documentation is coming I promise! I'm working my butt off ready for the 1.0 release on Monday, and it has docs. Hopefully will get time to do some mini getting started guides too. Link to comment Share on other sites More sharing options...
Recommended Posts