chessmasterhong / WaterEmblem

https://chessmasterhong.bitbucket.io/projects/WaterEmblem/
118 stars 27 forks source link

Improve tile highlighting algorithm #182

Open chessmasterhong opened 9 years ago

chessmasterhong commented 9 years ago

The current implementation highlights tiles without checking if the highlighted tile(s) are actually valid. This leads to confusion for the player as they cannot effectively determine what tiles can be moved on to or not.

An example would be the movement tile highlighting, where the algorithm would highlight all tiles based on the the unit's mov stat. It would still highlight a tile as movable even though it is not, such as water tiles or cliffs.

The objective is to extend the algorithm to check if the tile is a valid tile to move on to. The only known way to do this is for the algorithm to locate the tile position, look at the position in the collision map for the current level to see if the position is movable, and update the highlighting accordingly.