I'm working on a curses based rpg in c. The character representing the player is always in the center of the screen. And I obviously don't want him to go through walls. I thought about doing that by checking which character is at the desired location to move. So for example:
"y" and "x" represent the coordinates for the middle of the window. If a player wants to go up, I want it to look at the character with coordinates of "y-1, x" and then if it is not empty, block the action.
I couldn't find a function for that. If it's impossible to do, is there an alternative?
Thanks