|
@ -9,8 +9,8 @@ |
|
|
int wallX = 0; |
|
|
int wallX = 0; |
|
|
int wallY = 0; |
|
|
int wallY = 0; |
|
|
int wallLength = 0; |
|
|
int wallLength = 0; |
|
|
int BinX; |
|
|
|
|
|
int BinY = 10; |
|
|
|
|
|
|
|
|
int binX; |
|
|
|
|
|
int binY = 10; |
|
|
|
|
|
|
|
|
char field[fieldWidth][fieldHeigth]; |
|
|
char field[fieldWidth][fieldHeigth]; |
|
|
int windForce = 0; |
|
|
int windForce = 0; |
|
@ -60,8 +60,8 @@ void loadLevel(int lvlnum){ |
|
|
switch (lvlnum) |
|
|
switch (lvlnum) |
|
|
{ |
|
|
{ |
|
|
case(1): |
|
|
case(1): |
|
|
BinX = 12; |
|
|
|
|
|
BinY = 10; |
|
|
|
|
|
|
|
|
binX = 12; |
|
|
|
|
|
binY = 10; |
|
|
break; |
|
|
break; |
|
|
case(2): |
|
|
case(2): |
|
|
case(3): |
|
|
case(3): |
|
@ -78,35 +78,35 @@ void loadLevel(int lvlnum){ |
|
|
{ |
|
|
{ |
|
|
tmpY = rand() % 12; |
|
|
tmpY = rand() % 12; |
|
|
} |
|
|
} |
|
|
BinX = tmpX; |
|
|
|
|
|
BinY = tmpY; |
|
|
|
|
|
|
|
|
binX = tmpX; |
|
|
|
|
|
binY = tmpY; |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
case(7): |
|
|
case(7): |
|
|
BinX = 2; |
|
|
|
|
|
BinY = 7; |
|
|
|
|
|
|
|
|
binX = 2; |
|
|
|
|
|
binY = 7; |
|
|
windForce = -2; |
|
|
windForce = -2; |
|
|
printf("Ein Sturm zieht auf!\n"); |
|
|
printf("Ein Sturm zieht auf!\n"); |
|
|
sleep(3); |
|
|
sleep(3); |
|
|
|
|
|
|
|
|
break; |
|
|
break; |
|
|
case(8): |
|
|
case(8): |
|
|
BinX = 19; |
|
|
|
|
|
BinY = 7; |
|
|
|
|
|
|
|
|
binX = 19; |
|
|
|
|
|
binY = 7; |
|
|
windForce = 1; |
|
|
windForce = 1; |
|
|
break; |
|
|
break; |
|
|
case(9): |
|
|
case(9): |
|
|
windForce = -1; |
|
|
windForce = -1; |
|
|
BinX = 8; |
|
|
|
|
|
BinY = 9; |
|
|
|
|
|
|
|
|
binX = 8; |
|
|
|
|
|
binY = 9; |
|
|
wallX = 7; |
|
|
wallX = 7; |
|
|
wallLength = 4; |
|
|
wallLength = 4; |
|
|
wallY = 17; |
|
|
wallY = 17; |
|
|
break; |
|
|
break; |
|
|
case(10): |
|
|
case(10): |
|
|
windForce = 2; |
|
|
windForce = 2; |
|
|
BinX = 16; |
|
|
|
|
|
BinY = 12; |
|
|
|
|
|
|
|
|
binX = 16; |
|
|
|
|
|
binY = 12; |
|
|
wallX = 11; |
|
|
wallX = 11; |
|
|
wallLength = 4; |
|
|
wallLength = 4; |
|
|
wallY = 19; |
|
|
wallY = 19; |
|
@ -216,7 +216,7 @@ void clearField() |
|
|
|
|
|
|
|
|
void Generatefield() { |
|
|
void Generatefield() { |
|
|
system("clear"); |
|
|
system("clear"); |
|
|
buildBin(BinX, BinY); |
|
|
|
|
|
|
|
|
buildBin(binX, binY); |
|
|
|
|
|
|
|
|
if (ScorePoints < 0) |
|
|
if (ScorePoints < 0) |
|
|
ScorePoints = 0; |
|
|
ScorePoints = 0; |
|
@ -285,11 +285,11 @@ void addScoreboard() |
|
|
|
|
|
|
|
|
int checkBallPosition() |
|
|
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; |
|
|
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; |
|
|
return 2; |
|
|
} |
|
|
} |
|
|