From eb514527e480d3a7cd56728a4c49910bfec8a500 Mon Sep 17 00:00:00 2001 From: fdai7103 Date: Wed, 8 Feb 2023 22:58:42 +0100 Subject: [PATCH] =?UTF-8?q?refactoring:=20=C3=9Cbersicht:=20loadLevel?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Paper-Bin.c | 18 +++++++++++------- 1 file changed, 11 insertions(+), 7 deletions(-) diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index 8cd2f77..d661bec 100644 --- a/src/Paper-Bin.c +++ b/src/Paper-Bin.c @@ -54,10 +54,10 @@ void buildBin(int width, int heigth) void loadLevel(int lvlnum) { clearField(); - ballX = -1; - ballY = 27; + ballX = -1; + ballY = 27; - int tmpX,tmpY; + int tmpX,tmpY; switch (lvlnum) { @@ -65,6 +65,7 @@ void loadLevel(int lvlnum) binX = 12; binY = 10; break; + case(2): case(3): case(4): @@ -82,21 +83,22 @@ void loadLevel(int lvlnum) } binX = tmpX; binY = tmpY; - break; + case(7): binX = 2; binY = 7; windForce = -2; printf("Ein Sturm zieht auf!\n"); sleep(3); - break; + case(8): binX = 19; binY = 7; windForce = 1; break; + case(9): windForce = -1; binX = 8; @@ -105,6 +107,7 @@ void loadLevel(int lvlnum) wallLength = 4; wallY = 17; break; + case(10): windForce = 2; binX = 16; @@ -112,19 +115,20 @@ void loadLevel(int lvlnum) wallX = 11; wallLength = 4; wallY = 19; - break; + case(11): system("clear"); Generatefield(); addScoreboard(); sortScoreboard(); exit(0); - break; + default: exit(0); } + getStartPosition(); printf("Der Ball wird geworfen!!!"); sleep(1);