Original Post
Ok, normally I can figure small things like this out but this one evades me....
I''ve got code something like this....
...as a global integer array...
...Initialized ONCE in GAME_INIT like so...
...The ONLY TIME I ever use this in my Game_Main is with this code for comparing reasons
Now everything seems ok up until the end of my program....When I loop the program, I don''t reset the Array variables because I shouldn''t have to but IT CHANGES somehow when I only used it to compare...
This is a Tetris clone if you can''t tell by the Block Arrays yet, but it baffles me how Block_Array changes if I only ever use it to compare...
I print out the Block_Array (which is filled with 0''s or 1''s) and End up with things like this...
int Block_Array[7][4][4][4]; // [Block Number][Frame Number][Rows][Columns]
for (int zblocknum = 0; zblocknum <7; zblocknum++)
{
for (int zframenum = 0; zframenum < Block[zblocknum].Max_Frames; zframenum++)
{
for (int zrow = 0; zrow <4; zrow++)
{
for (int zcolumn = 0; zcolumn <4; zcolumn++)
{
Block_Array[zblocknum][zframenum][zrow][zcolumn] = 0;
}
}
}
}
// Defines Straight Piece....BLOCK 0
Block_Array[0][0][0][1] = 1;
Block_Array[0][0][1][1] = 1;
Block_Array[0][0][2][1] = 1;
Block_Array[0][0][3][1] = 1;
//... There are more Block_Array definitions, but I won''t list them all here...they are similar to the above
for (x = 0; x < 4; x++)
{
for (y = 0; y < 4; y++)
{
if (Block_Array[Blocknum][Block[Blocknum].current_frame][x][y] == 1)
Block_Board[Block[Blocknum].row+1 +x][Block[Blocknum].column+1 +y] = Blocknum;
}
}
0 1 0 0 0 0 0 0 1 0 0 0 1 0 0 or 0 1 0 1 0 0 0 1 0 0 0 1 0 0This only holds true for Block_Array[0][0][...][...], but it''s holding back my progress... ANY INSIGHT to why it may be causing this, I would definitely appreciate, sorry for the long post but if any more info is needed please post. Thanks! Josh