I am trying to build a simple tetris game within the terminal. I need to move the pieces when the player presses an arrow key. I heard about the getch() method but it doesn't seem to work with arrow keys (they were all detected with the same int code: 27). What should I do?
Here is my current code:
initscr();
int inputCode;
do
{
inputCode = getch();
// here I would put my code to move the pieces if the code is right
} while (inputCode != 113); // q to exit
endwin();
Sincerely, Thomas