Re: ideas for grid scanning system?
Having a hard time concentrating enough to fully flesh out this idea, but basicly you're wanting to create an alternative forloop manually. Here's what I have so far, let me know if it helps or not. idk.
Assuming your grid is held in a 2d array
int[][] grid;
void main()
{
grid.resize(10);
for(int x=0; x<10; x++)
{
grid[x].resize(10);
}
}
void checkGrid(int x, int y)
{
int uX=x+1;
int dX=x-1
int uY=y+1;
int dY=y-1;
int result=grid[x][y];
if(grid[uX][y]==result)
{
}
if(grid[dX][y]==result)
{
}
if(grid[x]uY]==result)
{
}
if(grid[x][dY]==result)
{
}
}
}
int checkSquares(int x, int y)
{
int uX=x+1;
int dX=x-1
int uY=y+1;
int dY=y-1;
int result=grid[x][y];
if(grid[uX][y]==result)
{
return grid[uX][y];
}
if(grid[dX][y]==result)
{
return grid[dX][y];<
br />}
if(grid[x]uY]==result)
{
return grid[x][uY];
}
if(grid[x][dY]==result)
{
return grid[x][dY];
}
}
}
It needs a lot more work to get it working, but hopefully it is enough to help you think in another direction. GF is wanting to watch house with me, so sorry. If you haven't figured it out by the time I get some more time I'll pick it back up and post it here.
_______________________________________________ Audiogames-reflector mailing list Audiogames-reflector@sabahattin-gucukoglu.com https://sabahattin-gucukoglu.com/cgi-bin/mailman/listinfo/audiogames-reflector