Hi all, I'm working on a game, and I have the necessity to check a closed path in a given numerical heightmap: The server and the client use this heightmap to set the right coords to move etc... Now, when an user walks on a "special" tile, it lights... My problem is: When an user, walking on these tiles creates a closed path with empty tiles in it, the server should automatically fill the tiles in this path...
It should do something like this: http://www.youtube.com/watch?v=kAVUNE2NTUQ - 1:32
I'm sure I've to use some maths here or there, but I dunno how... I could do a "for" cycle, but it would be too long, and the problem is that the server needs to do the cycle every time an user walks... Thanks in advance for your answers, hope someone could help me.
PS: I'm using C#
EDIT: When an user walks on a tile, the server automatically replaces the heightmap[X, Y] with an integer that represents the color of the user