I am currently developing a game for the iPhone/iPod/iPad. To store the board data, which is 12 columns by 8 rows, I have an array that stores pointers to one of the game items, a block. It is declared as follows:
BlockData* mBoard[kNumberOfColumns][kNumberOfRows];
I also have another array declared like this:
BlockData* mCenterSquare[16];
This I want to store pointers to specific locations on the board, for example,
mCenterSquare[0] = mBoard[4][5];
Is this the right way of doing it? What I want to accomplish using the above line of code is for mCenterSquare[0] to store a pointer to a position on the board - 4th column and 5th row. How would I go about doing this?
Thanks in advance.