From ddcf9bafcf284c7b249cf51137cb625c663af84c Mon Sep 17 00:00:00 2001 From: David PC Saiz Date: Thu, 9 Feb 2023 00:03:20 +0100 Subject: [PATCH] refactoring: Kommentare geschrieben --- src/Paper-Bin.c | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/Paper-Bin.c b/src/Paper-Bin.c index bb934fb..f4f6b59 100644 --- a/src/Paper-Bin.c +++ b/src/Paper-Bin.c @@ -294,13 +294,15 @@ void addScoreboard() fprintf(fp, "%s %d\n", name, scorePoints); fclose(fp); } - +//Checkt Position vom Ball int checkBallPosition() { + //Bei eineme Tor gibt es eine 1 zurück if (binY + 2 == ballY && (ballX == binX || ballX == binX + 1 || ballX == binX - 1)) { return 1; } + //Wenn der Ball daneben fliegt gibt es eine 2 zurück else if (binY + 1 >= ballY || field[ballX][ballY - 1] == '_' || ballX >= fieldWidth || ballX <= 0) { return 2;