Browse Source

checkballposition:Weitere bed.,feldgrösse global

main
fdai7103 2 years ago
parent
commit
d5db4bb843
  1. 10
      src/Paper-Bin.c

10
src/Paper-Bin.c

@ -9,6 +9,9 @@ char field[23][29];
int Ballx = -1;
int Bally = 27;
int fieldWidth = 25;
int fieldHeigth = 30;
void buildBin(int width, int heigth){
field[width][heigth] = 'V';
field[width+1][heigth+1] = '\\';
@ -96,9 +99,6 @@ void getStartPosition()
void clearField()
{
int fieldWidth = 25;
int fieldHeigth = 30;
for (int i = 0; i <= fieldWidth; i++)
{
for (int j = 0; j <= fieldHeigth; j++)
@ -132,4 +132,8 @@ int checkBallPosition()
{
return 1;
}
else if (BinY > Bally || field[Ballx][Bally - 1] == '_' || Ballx > fieldWidth || Ballx < 0)
{
return 2;
}
}
Loading…
Cancel
Save