|
@ -35,6 +35,8 @@ void drawField(int paddle1PositionY, int paddle2PositionY, Ball ball) { |
|
|
printf("%c", PADDLE); |
|
|
printf("%c", PADDLE); |
|
|
} else if (i >= paddle2PositionY && i < paddle2PositionY + PADDLE_LENGTH && j == 0) { |
|
|
} else if (i >= paddle2PositionY && i < paddle2PositionY + PADDLE_LENGTH && j == 0) { |
|
|
printf("%c", PADDLE); |
|
|
printf("%c", PADDLE); |
|
|
|
|
|
} else if (i == ball.y && j == ball.x) { |
|
|
|
|
|
printf("%c", BALL); |
|
|
} else { |
|
|
} else { |
|
|
printf(" "); |
|
|
printf(" "); |
|
|
} |
|
|
} |
|
@ -77,6 +79,7 @@ int getch(void) { |
|
|
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; |
|
|
|
|
|
Ball ball = {WIDTH / 2, HEIGHT / 2, 1, 1}; //Startposition&Geschwindigkeit Ball |
|
|
|
|
|
|
|
|
while (1) { |
|
|
while (1) { |
|
|
//Steuerung für Schläger 1 |
|
|
//Steuerung für Schläger 1 |
|
|