Browse Source

refactoring: einfügen_ballstruktur_headerdatei

remotes/origin/branchJulia
fdai8040 11 months ago
parent
commit
d5b2c9c54c
  1. 8
      src/main/c/Pong/pong.c
  2. 8
      src/main/c/Pong/pong.h

8
src/main/c/Pong/pong.c

@ -11,14 +11,6 @@
#define PADDLE "\033[1;31m#\033[0m"
#define BALL "\033[1;31mO\033[0m"
//Ballstruktur
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Ball;
// Bildschirm löschen nach Veränderung Position
void clearScreen() {
system("clear");

8
src/main/c/Pong/pong.h

@ -1,6 +1,14 @@
#ifndef PONG_H
#define PONG_H
//Ballstruktur
typedef struct {
int x;
int y;
int speedX;
int speedY;
} Ball;
int pong();
void resetScore(int *score1, int *score2);

Loading…
Cancel
Save