I wrote a pathfinding widget for maze-games, that use arrays of arrays to display 2-dimensional maps. It is not intended for diagonal movement. I might use it for a roguelike, for enemy movement, but just in case anybody else needs something like it, here's the code. Included in the .tws is an example of how you can use it, you can also browse the
demo page. When you hit "refresh" you will see the "ik" string move through the maze.
Note that the pathfinding, as it is, is suited for array-maps where the difference between passable and non-passable locations is coded in positive (passable) and negative (not passable) numbers. Also the map needs an outer boundary of non-passable locations.
feedback and suggestions are very welcome!
best wishes
engine
Comments
EDIT: Oh, I didn't realize it required Sugarcube. I'm pretty new at doing Twine.