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