This one I can't seem to figure out.
My game is a 3d game, and the map is stored in a 2D array like this:
.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
.0#2#2#2.0#2#2#2.0#2.0.0.0.0.0
.0#2.0.0.0.0#2#2.0#2.0.0.0.0.0
.0#2.0.0.0.0#2#2.0#2.0.0.0.0.0
.0#2#2hThT#2#2#2.0#2.0.0.0.0.0
.0.0.0.0.0.0.0#2.0#2#2.0.0.0.0
.0.0.0.0.0.0.0#2.0#2.0.0.0.0.0
#2#2#2hThT#2#2#2.0#2.0.0.0.0.0
.0.0.0.0.0.0.0.0.0#2.0.0.0.0.0
.0#2#2#2#2#2#2#2#2#2.0.0#2#2#2
.0#2.0.0.0.0.0.0.0.0.0.0.0.0.0
.0#2.0.0.0.0.0.0.0.0.0.0.0.0.0
.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
.1.1.1.1.1.1.1.1.1.1.1.1.1.1.1
What I want to be able to to is check if I can see a certain square at a given time to determine if I could see it, for example, what I could see would be like this
[Player is the XX, each cell is two characters]
.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
.0.0.0.0.0.0.0.0.0.0.0.0.0.0.0
#2.0.0XX.0.0
#2.0.0.0.0.0
#2.0.0.0.0.0
#2.0.0.0.0.0
#2#2.0.0.0.0
.0.0.0.0.0
#2.0.0.0.0.0
#2.0.0.0.0.0
#2.0.0#2#2#2
.0.0.0
.0.0.0
.0.0.0.0
.1.1.1.1
My question is how would I determine if I could see a cell?
Here is a screenshot of the game to clear it up a little bit
http://et.ath.cx/chogblasters4.jpg
I want to cover the stuff that the user won't see so it won't bog down performance, and just draw the stuff that matters.
Thanks, schloob.