From 4fc726b4becfe355204010658fc74c220711a1a4 Mon Sep 17 00:00:00 2001 From: fdai7184 Date: Fri, 10 Feb 2023 21:03:20 +0100 Subject: [PATCH] change getInput to have return --- src/input.c | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) diff --git a/src/input.c b/src/input.c index f035928..6e61ced 100644 --- a/src/input.c +++ b/src/input.c @@ -19,7 +19,7 @@ void Pausieren(); /** getInput gets the userinput and reacts to input of w,a,s,d, arrow keys, p or q * utilises getch() and kbhit, no parameters, no returns */ -void getInput(){ +char getInput(){ if(kbhit()){ char key= getch(); if(key == '\033'){ @@ -27,16 +27,16 @@ void getInput(){ char key = getch(); switch(key){ case 'A': - printf("up"); + return 'u'; break; case 'B': - printf("down"); + return 'd'; break; case 'C': - printf("right"); + return 'r'; break; case 'D': - printf("left"); + return 'l'; break; } }