|
|
@ -124,6 +124,14 @@ void resetScore(int *score1, int *score2) { |
|
|
|
*score2 = 0; |
|
|
|
} |
|
|
|
|
|
|
|
int checkGameEnd(int score1, int score2, int maxScore) { |
|
|
|
if (score1 >= maxScore || score2 >= maxScore) { |
|
|
|
return 1; // Das Spiel endet |
|
|
|
} else { |
|
|
|
return 0; // Das Spiel endet nicht |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
int pong(){ |
|
|
|
int paddle1PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; |
|
|
|
int paddle2PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; |
|
|
@ -203,14 +211,6 @@ int pong(){ |
|
|
|
printf("Spieler 2 gewinnt!\n"); |
|
|
|
} |
|
|
|
|
|
|
|
int checkGameEnd(int score1, int score2, int maxScore) { |
|
|
|
if (score1 >= maxScore || score2 >= maxScore) { |
|
|
|
return 1; // Das Spiel endet |
|
|
|
} else { |
|
|
|
return 0; // Das Spiel endet nicht |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
return 0; |
|
|
|
} |
|
|
|
|
|
|
|