|
|
@ -66,76 +66,76 @@ void loadLevel(int lvlnum) |
|
|
|
|
|
|
|
switch (lvlnum) |
|
|
|
{ |
|
|
|
//Level 1 nur der Korb wird Erstellt |
|
|
|
case(1): |
|
|
|
binX = 12; |
|
|
|
binY = 10; |
|
|
|
break; |
|
|
|
|
|
|
|
//Level 2-6 Zufällige positionen für den Korb hinzugefügt |
|
|
|
case(2): |
|
|
|
case(3): |
|
|
|
case(4): |
|
|
|
case(5): |
|
|
|
case(6): |
|
|
|
tmpX = rand() % 19; |
|
|
|
//Level 1 nur der Korb wird Erstellt |
|
|
|
case(1): |
|
|
|
binX = 12; |
|
|
|
binY = 10; |
|
|
|
break; |
|
|
|
|
|
|
|
//Level 2-6 Zufällige positionen für den Korb hinzugefügt |
|
|
|
case(2): |
|
|
|
case(3): |
|
|
|
case(4): |
|
|
|
case(5): |
|
|
|
case(6): |
|
|
|
tmpX = rand() % 19; |
|
|
|
tmpY = rand() % 12; |
|
|
|
while (5 >tmpX) |
|
|
|
{ |
|
|
|
tmpX = rand()%19; |
|
|
|
} |
|
|
|
while (5 > tmpY) |
|
|
|
{ |
|
|
|
tmpY = rand() % 12; |
|
|
|
while (5 >tmpX) |
|
|
|
{ |
|
|
|
tmpX = rand()%19; |
|
|
|
} |
|
|
|
while (5 > tmpY) |
|
|
|
{ |
|
|
|
tmpY = rand() % 12; |
|
|
|
} |
|
|
|
binX = tmpX; |
|
|
|
binY = tmpY; |
|
|
|
break; |
|
|
|
|
|
|
|
//Wind wird dem Level hinzugefügt |
|
|
|
case(7): |
|
|
|
binX = 2; |
|
|
|
binY = 7; |
|
|
|
windForce = -2; |
|
|
|
printf("Ein Sturm zieht auf!\n"); |
|
|
|
sleep(3); |
|
|
|
break; |
|
|
|
|
|
|
|
case(8): |
|
|
|
binX = 19; |
|
|
|
binY = 7; |
|
|
|
windForce = 1; |
|
|
|
break; |
|
|
|
|
|
|
|
//Wände erscheinen jetzt in den Leveln |
|
|
|
case(9): |
|
|
|
windForce = -1; |
|
|
|
binX = 8; |
|
|
|
binY = 9; |
|
|
|
wallX = 7; |
|
|
|
wallLength = 4; |
|
|
|
wallY = 17; |
|
|
|
break; |
|
|
|
|
|
|
|
case(10): |
|
|
|
windForce = 2; |
|
|
|
binX = 16; |
|
|
|
binY = 12; |
|
|
|
wallX = 11; |
|
|
|
wallLength = 4; |
|
|
|
wallY = 19; |
|
|
|
break; |
|
|
|
//Abschluss aller Level |
|
|
|
case(11): |
|
|
|
system("clear"); |
|
|
|
generateField(); |
|
|
|
addScoreboard(); |
|
|
|
sortScoreboard(); |
|
|
|
exit(0); |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
exit(0); |
|
|
|
} |
|
|
|
binX = tmpX; |
|
|
|
binY = tmpY; |
|
|
|
break; |
|
|
|
|
|
|
|
//Wind wird dem Level hinzugefügt |
|
|
|
case(7): |
|
|
|
binX = 2; |
|
|
|
binY = 7; |
|
|
|
windForce = -2; |
|
|
|
printf("Ein Sturm zieht auf!\n"); |
|
|
|
sleep(3); |
|
|
|
break; |
|
|
|
|
|
|
|
case(8): |
|
|
|
binX = 19; |
|
|
|
binY = 7; |
|
|
|
windForce = 1; |
|
|
|
break; |
|
|
|
|
|
|
|
//Wände erscheinen jetzt in den Leveln |
|
|
|
case(9): |
|
|
|
windForce = -1; |
|
|
|
binX = 8; |
|
|
|
binY = 9; |
|
|
|
wallX = 7; |
|
|
|
wallLength = 4; |
|
|
|
wallY = 17; |
|
|
|
break; |
|
|
|
|
|
|
|
case(10): |
|
|
|
windForce = 2; |
|
|
|
binX = 16; |
|
|
|
binY = 12; |
|
|
|
wallX = 11; |
|
|
|
wallLength = 4; |
|
|
|
wallY = 19; |
|
|
|
break; |
|
|
|
//Abschluss aller Level |
|
|
|
case(11): |
|
|
|
system("clear"); |
|
|
|
generateField(); |
|
|
|
addScoreboard(); |
|
|
|
sortScoreboard(); |
|
|
|
exit(0); |
|
|
|
break; |
|
|
|
|
|
|
|
default: |
|
|
|
exit(0); |
|
|
|
} |
|
|
|
|
|
|
|
getStartPosition(); |
|
|
|