diff --git a/src/main/c/Pong/game.c b/src/main/c/Pong/game.c index c6067ed..f0f382e 100644 --- a/src/main/c/Pong/game.c +++ b/src/main/c/Pong/game.c @@ -35,6 +35,8 @@ void drawField(int paddle1PositionY, int paddle2PositionY, Ball ball) { printf("%c", PADDLE); } else if (i >= paddle2PositionY && i < paddle2PositionY + PADDLE_LENGTH && j == 0) { printf("%c", PADDLE); + } else if (i == ball.y && j == ball.x) { + printf("%c", BALL); } else { printf(" "); } @@ -77,6 +79,7 @@ int getch(void) { int main(){ int paddle1PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; int paddle2PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; + Ball ball = {WIDTH / 2, HEIGHT / 2, 1, 1}; //Startposition&Geschwindigkeit Ball while (1) { //Steuerung für Schläger 1