diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index 560b118..e2a2adf 100644 --- a/src/Paper-Bin.c +++ b/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; + } }