Original Post
Im pretty new to using multidimensional arrays larger than 2Ds. Im using a 3D one a look up table for getting the stats of enemy ships in the 2D shooter Im making. ive worked out how to initialise and declare it based on how it is done with 1D and 2D arrays, but I must be missing something because I keep getting syntax compiler errors when trying compile the following code.
static int tableEnemyShip[NUM_ENEMY_CLASS][NUM_ENEMY_SHIPS_IN_CLASS][NUM_ENEMY_DATA] = {
//==========PRESET AI ROUTINE CLASS OF SHIPS=======================//
{
//cruiser Type
{AI_DOWN,ENEMY_CR_HLTH,ENEMY_CR_HLTH,ENEMY_CR_DX,ENEMY_CR_DY,NUM_CRUISERS,
ENEMY_CR_FRAMES,ENEMY_CR_HEIGHT,ENEMY_CR_WIDTH,ENEMY_CR_GRID}
},//end set AI routine class
//=============PRESET DIR CLASS OF SHIPS================================
{
//ship 1
{ENEMY_SD1_DX_MOD,ENEMY_SD1_HLTH,ENEMY_SD1_HLTH,ENEMY_SD1_DX,ENEMY_SD1_DY,ENEMY_SD1_NUM,
ENEMY_SD1_FRAMES,ENEMY_SD1_HEIGHT,ENEMY_SD1_WIDTH,ENEMY_SD1_GRID}
}
};
|