From 147f77a7cbede97ea1f551e72e0b649663762f34 Mon Sep 17 00:00:00 2001 From: fdai7184 Date: Wed, 8 Feb 2023 21:30:27 +0100 Subject: [PATCH] add pause --- src/input.c | 11 +++++++++++ 1 file changed, 11 insertions(+) diff --git a/src/input.c b/src/input.c index c353ab7..ce3f93b 100644 --- a/src/input.c +++ b/src/input.c @@ -49,11 +49,22 @@ void getInput(){ else if(key=='q'){ printf("quit"); } + else if(key=='p'){ + printf("game paused, p to continue"); + pause(); + printf("game continued"); + } } } } +pause(){ +while(getch()!='p'){ + sleep(1); +} +} + //khbit und getch aus dem Internet