Here is what Ive been trying:
Code:
bool CBlock::move(int _x, int _y) {
CHAR_INFO charInfo[80*25];
COORD bufferSize = { 80, 25 };
COORD bufferCoord = { 0, 0 };
SMALL_RECT smallRect;
if (!ReadConsoleOutput(GetStdHandle(STD_OUTPUT_HANDLE), charInfo, bufferSize, bufferCoord, &smallRect)) {
MessageBox(0, "ERROR", "ERROR", MB_OK);
}
if (charInfo[_x*80+_y].Char.AsciiChar != '#') {
x = _x;
y = _y;
return true;
}
else return false;
}
So according to this, if _x and _y on the screen buffer are '#', the fucntion should return false, but it doesnt! what am I doing wrong? this is killing me!