How do I tell what character is in a space?
Okay, here is a wierd one that I can't figure out. I am making a simple racing game. When the player pushes the arrows on the number pad, the "car" (actually a single character symbol) moves in the appropriate direction. The thing is, I want to be able to check if they have crashed into a wall, driven over a powerup, or anything else. To do this, I was thinking of going to the location they wish to drive into, checking it to see what symbol is there, and returning a result. If it is a wall, the result would be 1, to mean they have crashed, etc. The only thing is I don't know how to check the space to see what character is there. May sound complicated and wierd, most likely because of how I typed it. I put a bit of example source code below if that helps. Any ideas would be great. Thanks in advance!
int PlayerX, // X location of car
PlayerY, // Y location of car
Symbol = '!';// Car symbol
const char Wall = '#', // What a wall looks like
Powerup = '*'; // A powerup
char Move; // The number the player presses
Move = getch(); // Getting their movement
if (Move == '8') // This will move them forward
PlayerY--; // This will move them up one space
//This is where I need help. How do I check to see what
//character is in the space they wish to enter?
} // Move Forward
...BLA BLA BLA continues on with other movement options
If it is unclear please tell me, because I really would like this to work. Another quick question. How do I keep a timer running in the background, to see how much time they have taken to finish the race in comparision to others and such. I want it to keep running no matter what they do. I am not sure how to though. Any help appreciated. Thanks everyone who looks at this problem for me!