From bf525fba47c8ea8972bbbd8353b83b607522a194 Mon Sep 17 00:00:00 2001 From: Charadon Date: Tue, 14 Jun 2022 19:24:10 -0400 Subject: Fixed issue #5 --- src/marathon.c | 8 ++++++++ 1 file changed, 8 insertions(+) (limited to 'src') diff --git a/src/marathon.c b/src/marathon.c index a04519a..c2492a6 100644 --- a/src/marathon.c +++ b/src/marathon.c @@ -109,11 +109,19 @@ void marathon_main() { MainCamera.offset = (Vector2){0, 0}; MainCamera.rotation = 0; bool MarathonGoing = true; + bool HasScored = false; while(MarathonGoing == true && GameGoing == true) { if (WindowShouldClose()) { //Quit Game if the window is closed. GameGoing = false; } + //Prevents multi-scoring in some cases. + if (Ball.Direction == LEFT) { + HasScored = true; + } else { + HasScored = false; + } + snprintf(PlayerScore, 50, "Player: %d", Player.Score); MainCamera.zoom = GetScreenHeight()/720.0f; MainCamera.offset = (Vector2){GetScreenWidth()/2.0f, GetScreenHeight()/2.0f}; -- cgit 1.4.1-2-gfad0