Any reason for using a corner of the hexagons instead of their centers?
If done manually with events you'll use this for finding the path:
https://en.wikipedia.org/wiki/A*_search_algorithm
The difference between a hex grid and a rectangular grid is just how the neighboring grids are found. For simplicity collision detection can be used.
Here's an example:
https://www.dropbox.com/s/dwg8owxstf76g ... .capx?dl=1
/examples29/astar_hex.capx
In it it defines a function "astar", which you call with two iids: a start and and end node. After the function the start node's node.next will be the uid of the next node in the path. This can then be repeatedly followed to the end node. For smooth motion you'll have to use the moveto behavior or devise your own method.
Event #9 is where you control the cost to move to a node. Right now it uses the distance times the average of the node costs, but there's no reason you couldn't tweak it to be based on other factors.
Wow R0J0hound that was awesome and is running amazingly fast, runs at 1 % in my Laptop <img src="{SMILIES_PATH}/icon_e_biggrin.gif" alt=":D" title="Very Happy">
I was looking for some type of Pathfinder like this for a "Bomber Man" like Game which turns out is an incredible challenge the Ai, I try it to replicate your Capx to use it with Squares tiles and I got some troubles that I can't figure it out, I would love if you can give any advice if possible:
1-My first problem is that on this capx moves in diagonals swell but in Bomber Man only moves four directions (Up, Down, Left, Right) is there is any possibility that it doesn't count the diagonal moves? so it doesn't go through between two solids blocks
2-How would I make the same thing but for each Enemy? Example Each Enemy has to find his Path to the Player independently, will be possible to do this without Arrays?
3-I haven't touch much the official Pathfinder in c2, will it be better for a Game like this to use the official Pathfinder or what would you recommend with your experience?
I hope you can give me some guidance as I'm a bit stack here, thank you so much for your Time
This is what I got so far:
https://www.dropbox.com/s/zcww0mepocp26k3/FindPath1.capx?dl=0