Browse Source

refactoring: Variablennamen für den Korb korrigiert

main
fdai7037 2 years ago
parent
commit
aba53a6fdd
  1. 34
      src/Paper-Bin.c

34
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;
}

Loading…
Cancel
Save