Hi all, im making a game in c++ and i have a problem.. well its not a problem but i want to know the best way to compare the colors with te row and the columns, the way im thinking is .. something like this.. :
char board[7][7];
int row , col = 1;
int srch=1;
for(row=6;row>1;row--)
{
if (map[row][col]== map [row][col+srch] && map[row][col]== map [row][col+srch+1] && ..... map[row][col+srch+3]== map [row][col+srch+4])
{
map[row][col]=' ';
...
map[row][col+srch+4]=' ';
}
else
else
else....etc
{
srch++;
}
} ....
well something like that ....establishing all the possible IF opcions :S... but there is a easier way to detect the collisions?? like in c# bounds.intersect? ... as you can see, in the board, 1 is for RED, 2 is BLUE, 3 YELLOW, 4 Green .. when there are 4 or more of the same kind intersecting they're all destroyed.. so is a better way or function ? im using c++ and allegro.. thank you all for your help.