|
I'm working on a HoMM3 clone. I've got a hex map in form of a 2D array
Each unit has a variable
Bear with the yellow highlight is the active monster, it has speed of 6 (as seen on his left side), but due to obstacles and units in north-east direction, he can't go everywhere where he normally could, as he must take the longer route. I need this script to change More info:
(comments are locked)
|
|
cool enought, but I think you might be more/better help from a GameDeveloper forum such as: http://gamedev.stackexchange.com/ Because your problem seems to me, more of a HEX-tile question than an actual Unity problem.
(comments are locked)
|
|
Hex tile movement is actually really simple: if you are using a 2-d array to represent your tiles, and you are at tile position X,Y:
To visualize why this works, simply shift every other row in a square grid half a space to the right (sorry I don't have a picture off-hand)
(comments are locked)
|


Unless I am missing something you are already calculating all the hexes your unit can move to (The dark shaded ones). Can't you just set your flag when you shade the hex?