From 6734e1abc22ebc85a3e1ff90f8ba1375966f4e1f Mon Sep 17 00:00:00 2001 From: fdai7184 Date: Fri, 10 Feb 2023 02:55:52 +0100 Subject: [PATCH] add quit bool in Main.c --- src/Main.c | 3 ++- src/input.c | 5 +++-- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/src/Main.c b/src/Main.c index 9288383..c15526b 100644 --- a/src/Main.c +++ b/src/Main.c @@ -1,9 +1,10 @@ - +#include /**Main Methode die das Spiel startet, loopt und beendet * indem die anderen Methoden/Funktionen aufgerufen werden */ int main(int argc, char ** argv){ + bool quit=0; //Name abfragen //Setup diff --git a/src/input.c b/src/input.c index a16a889..f035928 100644 --- a/src/input.c +++ b/src/input.c @@ -6,6 +6,7 @@ #include int kbhit(void); char getch(void); +void Pausieren(); /*int main(int argc, char ** argv){ @@ -60,7 +61,7 @@ void getInput(){ case 'p': printf("\033[31mgame paused, p to continue"); printf("\033[0m"); - pause(); + Pausieren(); printf("\033[32mgame continued"); printf("\033[0m"); break; @@ -102,7 +103,7 @@ char getTInput(char key){ /** pauses the game until p is pressed again * no parameters, no returns */ -void pause(){ +void Pausieren(){ while(getch()!='p'){ sleep(0.10); }