|
|
@ -85,6 +85,7 @@ int main(){ |
|
|
|
Ball ball = {WIDTH / 2, HEIGHT / 2, 1, 1}; //Startposition&Geschwindigkeit Ball |
|
|
|
int score1 = 0; |
|
|
|
int score2 = 0; |
|
|
|
int maxScore = 5; |
|
|
|
|
|
|
|
while (1) { |
|
|
|
//Steuerung für Schläger 1 |
|
|
@ -137,7 +138,13 @@ int main(){ |
|
|
|
ball.speedX = -ball.speedX; |
|
|
|
} |
|
|
|
|
|
|
|
draw Field(paddle1PositionY, paddle2PositionY); |
|
|
|
draw Field(paddle1PositionY, paddle2PositionY,score1, score2); |
|
|
|
|
|
|
|
// Spielende überprüfen |
|
|
|
if (score1 == maxScore || score2 == maxScore) { |
|
|
|
printf("Spiel beendet!\n"); |
|
|
|
break; |
|
|
|
} |
|
|
|
|
|
|
|
usleep(100000); //Verlangsamen Schleife/Spiel |
|
|
|
} |
|
|
|