Browse Source

Implementierung Ball

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

11
src/main/c/Pong/game.c

@ -7,13 +7,22 @@
#define HEIGHT 20 //Höhe Spielfeld
#define PADDLE_LENGTH 4
#define PADDLE '#'
#define BALL 'O'
//Ballstruktur
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Ball;
// Bildschirm löschen nach Veränderung Position
void clearScreen() {
system("clear");
}
void drawField(int paddle1PositionY, int paddle2PositionY) {
void drawField(int paddle1PositionY, int paddle2PositionY, Ball ball) {
clearScreen();
for (int i = 0; i <= HEIGHT; i++){

Loading…
Cancel
Save