Browse Source

change getInput to have return

main
fdai7184 2 years ago
parent
commit
4fc726b4be
  1. 10
      src/input.c

10
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;
}
}

Loading…
Cancel
Save