I'm using the GetAsyncKeyState function to move a char "H" inside a 10x10 array. "H" can only move where there is an empty space, or it replaces whatever I tell it to. When "H" eats a "C", I want to cout "Hey a clue" and give "H" some choices. How can "H" eat the "C" and cout a mesg at the same time?
if (GameMap [y2] [x] == 'C'){
GameMap [y] [x] = ' ';
y ++;
GameMap [y] [x] = 'H';
cout << "Hey, there's a clue on the ground!\n";
system ("pause");
}
Tried this three combos...any help would be appreciated. Thanks.
use a for loop to access each element of the array then use an if statement to check if the element contains a "C" or not, then replace it and cout "Hey a clue" else it would just replace anything in the array with "H".