From d05a98f3ebb7f826e39557e28ae7c2cf693205bb Mon Sep 17 00:00:00 2001 From: fdai7184 Date: Fri, 10 Feb 2023 01:44:04 +0100 Subject: [PATCH] add getTInput to test Input --- src/input.c | 29 +++++++++++++++++++++++++++++ 1 file changed, 29 insertions(+) diff --git a/src/input.c b/src/input.c index b3d3727..2cfd6e4 100644 --- a/src/input.c +++ b/src/input.c @@ -70,6 +70,35 @@ void getInput(){ } } +/** getTInput with parameters to test if working correctly + * returns char, parameter: char + */ +char getTInput(char key){ + if(key == '\033'){ + return 'ar'; + } + else{ + switch(key){ + case 'w': + return 'w'; + case 'a': + return 'a'; + case 's': + return 's'; + case 'd': + return 'd'; + case 'q': + return 'q'; + case 'p': + return 'p'; + } + + } + + + } + + /** pauses the game until p is pressed again * no parameters, no returns */