|
@ -24,6 +24,7 @@ void drawField(int paddle1PositionY, int paddle2PositionY) { |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
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; |
|
@ -39,7 +40,15 @@ int main(){ |
|
|
} |
|
|
} |
|
|
} |
|
|
} |
|
|
|
|
|
|
|
|
// Hier Steuerung für Schläger 2 noch reinschreiben |
|
|
|
|
|
|
|
|
//Steuerung für Schläger 2 |
|
|
|
|
|
if (kbhit()){ |
|
|
|
|
|
char input = getch(); |
|
|
|
|
|
if (input == 'i' && paddle2PositionY > 1) { |
|
|
|
|
|
paddle2PositionY--; |
|
|
|
|
|
} else if (input == 'k' && paddle2PositionY < HEIGHT - PADDLE_LENGTH - 1){ |
|
|
|
|
|
paddle2PositionY++; |
|
|
|
|
|
} |
|
|
|
|
|
} |
|
|
|
|
|
|
|
|
draw Field(paddle1PositionY, paddle2PositionY); |
|
|
draw Field(paddle1PositionY, paddle2PositionY); |
|
|
|
|
|
|
|
|