From 1ce01e7bb349af9b407115fb0faf31b1c2b94794 Mon Sep 17 00:00:00 2001 From: fdai8040 Date: Wed, 31 Jan 2024 16:42:54 +0000 Subject: [PATCH] refactoring:_aktualisieren_ballposition_nun_an_zentraler_Stelle --- src/main/c/Pong/game.c | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/src/main/c/Pong/game.c b/src/main/c/Pong/game.c index 75fdbc6..c74f466 100644 --- a/src/main/c/Pong/game.c +++ b/src/main/c/Pong/game.c @@ -83,6 +83,13 @@ int getch(void) { return ch; } +//Aktualisierung Ballposition +void updateBallPosition(Ball *ball) { + ball->x += ball->speedX; + ball->y += ball->speedY; +} + + int main(){ int paddle1PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; int paddle2PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2;