Thanks for your kindness and help. Much appreciate! Can someone explain to me this part of the coding:
{
if (GetAsyncKeyState(VK_UP)) {
if (map[y - 1][x] == '.') { y--; pts++; }
else if (map[y - 1][x] == ' ') y--;
}
if (GetAsyncKeyState(VK_DOWN)) {
if (map[y + 1][x] == '.') { y++; pts++; }
else if (map[y + 1][x] == ' ') y++;
}
if (GetAsyncKeyState(VK_LEFT)) {
if (map[y][x - 1] == '.') { x--; pts++; }
else if (map[y][x - 1] == ' ') x--;
}
if (GetAsyncKeyState(VK_RIGHT)) {
if (map[y][x + 1] == '.') { x++; pts++; }
else if (map[y][x + 1] == ' ') x++;
}
}
Aucun commentaire:
Enregistrer un commentaire