about summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--src/marathon.c8
1 files changed, 8 insertions, 0 deletions
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};