Hi ! I recently stumbled upon this neat little API for pathfinding and thought it would be cool to wrap it up inside a plugin/behavior for C2. I thought a behavior extending the official tilemap made the most sense for this so here goes :
live example (Drag and drop the blue/green square, and right-click to add/remove obstacle.)
example capx
behavior files
easystar demo done in C2 (need moveTo behavior)
live version
The behavior is rather straightforward, just hook it up to a tilemap, define walkables tiles with the appropriate actions and you're set. It uses a tag system so you can make multiple find path calls simultaneously, and EasyStar.js allows for asynchronous calculation if need be. Just try it out !
edit: corrected links, added another demo
New behavior files v1.01
v1.01 has an updated core (now using EasyStar 0.2.3, slightly modified to accommodate C2)
Key features are an optimized algorithm, possibility to add specific costs at tile coordinates, option to enable/disable corner cutting when moving diagonally
Does the example work properly with the updated files? Doesn't seem to draw the route properly?