Hey guys
I am working on a small game. and I would like a design suggestion.
At the moment I am creating single Characters to represent the objects in a maze, then assigning them to the maze. So far I am doing it this way:
Code:
void createGoalList ( char Mz[][ 50 ] )
{
char cheese[] = "C";
char key[] = "K";
char exit[] = "E";
char trap[] = "T";
assignGoalsToMaze ( Mz, cheese, key, exit, trap );
}
// function to set the goals to the maze locations
void assignGoalsToMaze ( char Mz[][ 50 ], char *pChse, char *pKey, char *pEx, char *pTp )
{
Mz[ 5 ][ 7 ] = *pChse;
}
Would it be more senisble to make an array of pointers here? Sort of:
Code:
char *pItems[ 4 ] = { "C", "K", "E", "T" };
Or is it more suitable to deploy the technique I have been using, which I am having no problems with thus far; compiling ok etc.
Any suggestions appreiciated.