From what I see, your collision detection consists of checking if the character value at the current coordinates is 'X' -- which is how you represent your walls.

It's likely that the character value you attempt to get in getchxy() doesn't successfully make it to the intersection test. Have you tried adding a breakpoint for getchxy() and stepping through the function when you're at a wall's coordinates? It should become clear by looking at the local variables in the debugger whether the 'X' value at those coordinates gets successfully retrieved through GetConsoleScreenBufferInfo() and ReadConsoleOutputCharacter() (and is returned to your main() for the intersection test).