Browse Source

refactoring:_aktualisieren_ballposition_nun_an_zentraler_Stelle

remotes/origin/branchJulia
fdai8040 11 months ago
parent
commit
1ce01e7bb3
  1. 7
      src/main/c/Pong/game.c

7
src/main/c/Pong/game.c

@ -83,6 +83,13 @@ int getch(void) {
return ch; return ch;
} }
//Aktualisierung Ballposition
void updateBallPosition(Ball *ball) {
ball->x += ball->speedX;
ball->y += ball->speedY;
}
int main(){ int main(){
int paddle1PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; int paddle1PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2;
int paddle2PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2; int paddle2PositionY = HEIGHT / 2 - PADDLE_LENGTH / 2;

Loading…
Cancel
Save