0

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

peonerovv
  • 3
  • 2
  • 2
    Does this answer your question? [Check char at current/given position in PDCurses/NCurses](https://stackoverflow.com/questions/8066592/check-char-at-current-given-position-in-pdcurses-ncurses) – joshmeranda Aug 15 '21 at 16:36
  • https://invisible-island.net/ncurses/man/curs_inch.3x.html – pmg Aug 15 '21 at 16:53

0 Answers0