|
|
@ -50,6 +50,7 @@ void drawField(int paddle1PositionY, int paddle2PositionY, Ball ball, int score1 |
|
|
|
} else { |
|
|
|
printf("Drücken Sie 'p', um das Spiel zu pausieren.\n"); |
|
|
|
} |
|
|
|
printf("Drücken Sie 'q', um das Spiel zu beenden.\n"); |
|
|
|
} |
|
|
|
|
|
|
|
int kbhit(void){ |
|
|
@ -141,8 +142,12 @@ int main(){ |
|
|
|
paddle1PositionY++; |
|
|
|
} else if (input == 'p') { |
|
|
|
isPaused = !isPaused; |
|
|
|
} |
|
|
|
} else if (input == 'q') { |
|
|
|
clearScreen(); |
|
|
|
printf("Spiel beendet.\n"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|
//Steuerung für Schläger 2 |
|
|
|
if (!isPaused && kbhit()){ |
|
|
@ -153,6 +158,10 @@ int main(){ |
|
|
|
paddle2PositionY++; |
|
|
|
} else if (input == 'p') { |
|
|
|
isPaused = !isPaused; |
|
|
|
} else if (input == 'q') { |
|
|
|
clearScreen(); |
|
|
|
printf("Spiel beendet.\n"); |
|
|
|
return 0; |
|
|
|
} |
|
|
|
} |
|
|
|
|
|
|
|