From aba53a6fddf55862ee3e59baec260904d3931fb5 Mon Sep 17 00:00:00 2001 From: fdai7037 Date: Wed, 8 Feb 2023 22:50:50 +0100 Subject: [PATCH] =?UTF-8?q?refactoring:=20Variablennamen=20f=C3=BCr=20den?= =?UTF-8?q?=20Korb=20korrigiert?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- src/Paper-Bin.c | 34 +++++++++++++++++----------------- 1 file changed, 17 insertions(+), 17 deletions(-) diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index 7cbdd6e..0e4bfa5 100644 --- a/src/Paper-Bin.c +++ b/src/Paper-Bin.c @@ -9,8 +9,8 @@ int wallX = 0; int wallY = 0; int wallLength = 0; -int BinX; -int BinY = 10; +int binX; +int binY = 10; char field[fieldWidth][fieldHeigth]; int windForce = 0; @@ -60,8 +60,8 @@ void loadLevel(int lvlnum){ switch (lvlnum) { case(1): - BinX = 12; - BinY = 10; + binX = 12; + binY = 10; break; case(2): case(3): @@ -78,35 +78,35 @@ void loadLevel(int lvlnum){ { tmpY = rand() % 12; } - BinX = tmpX; - BinY = tmpY; + binX = tmpX; + binY = tmpY; break; case(7): - BinX = 2; - BinY = 7; + binX = 2; + binY = 7; windForce = -2; printf("Ein Sturm zieht auf!\n"); sleep(3); break; case(8): - BinX = 19; - BinY = 7; + binX = 19; + binY = 7; windForce = 1; break; case(9): windForce = -1; - BinX = 8; - BinY = 9; + binX = 8; + binY = 9; wallX = 7; wallLength = 4; wallY = 17; break; case(10): windForce = 2; - BinX = 16; - BinY = 12; + binX = 16; + binY = 12; wallX = 11; wallLength = 4; wallY = 19; @@ -216,7 +216,7 @@ void clearField() void Generatefield() { system("clear"); - buildBin(BinX, BinY); + buildBin(binX, binY); if (ScorePoints < 0) ScorePoints = 0; @@ -285,11 +285,11 @@ void addScoreboard() int checkBallPosition() { - if (BinY + 2 == Bally && (Ballx == BinX || Ballx == BinX + 1 || Ballx == BinX - 1)) + if (binY + 2 == Bally && (Ballx == binX || Ballx == binX + 1 || Ballx == binX - 1)) { return 1; } - else if (BinY + 1 >= Bally || field[Ballx][Bally - 1] == '_' || Ballx >= fieldWidth || Ballx <= 0) + else if (binY + 1 >= Bally || field[Ballx][Bally - 1] == '_' || Ballx >= fieldWidth || Ballx <= 0) { return 2; }