[SDL] ot - storing game data
neil at cloudsprinter.com
neil at cloudsprinter.com
Sat Sep 1 13:39:42 PDT 2007
currently i have this setup to hold data about the board in a puzzle game
static char * board_one[] = {
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ",
"xxxxxxxx ", };
what i really want is an array of these so i dont have to have the _one so i can
read data in better and easier.
i understand i am not allowed to have 3d character arrays unless i know they are
all going to be the same size
currently the size is told to the reading part which then collects the dtat from
the board_one array.
i am informed i can have 3d character arrays as lon as they are all the same
size, so i am thinking just have a predfiened array size that tells me the size
of the rest of the array in the first line, so even if the board is only 5x5 it
still sits in a, say, 12x12 array
then i can collect my data like and here is where it all falls apart, how can i
hold the data i want easilly so it is as the board_one definition above, but
only board[1].
hope this all makes a little sence, any suggestions on a way of handling a 3d
character array or different data store soloutions always welcome.
More information about the SDL
mailing list