From 7bd8731cbb214a6d19657f68196e379d800513fa Mon Sep 17 00:00:00 2001 From: bhattial100541 Date: Sun, 14 Dec 2025 04:34:32 +0100 Subject: [PATCH] Puntestand einbauen --- src/main.cpp | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/main.cpp b/src/main.cpp index 6bc7209..ee584bc 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -205,6 +205,8 @@ int main() gamecube* second = nullptr; float flipSpeed = 5.0f; // Drehgeschwindigkeit bool gameWon = false; + int moves = 0; + // Fenster und Kamera InitWindow(800, 600, "3D Memory Game with Matrix3D Library"); @@ -237,6 +239,8 @@ int main() first = second = nullptr; currentScreen = GAMEPLAY; timerStarted = false; // Timer-Reset + moves = 0; + } else if (IsKeyPressed(KEY_SIX)) { selectedPairs = 6; // 12 Würfel SetupGame(cubes, selectedPairs); @@ -244,6 +248,8 @@ int main() first = second = nullptr; currentScreen = GAMEPLAY; timerStarted = false; // Timer-Reset + moves = 0; + } break; } @@ -339,6 +345,8 @@ int main() if (first && second && first->IsFlipped() && second->IsFlipped()) >>>>>>> 5fc4346 (funktioniert, 3 oder 6 + Timer komplett) { + moves++; + Color col1 = first->GetColor(); Color col2 = second->GetColor(); @@ -416,6 +424,11 @@ int main() char liveBuf[64]; sprintf(liveBuf, "Time: %.2f", GetTime() - startTime); DrawText(liveBuf, 10, 40, 20, DARKGRAY); + + char moveBuf[64]; + snprintf(moveBuf, sizeof(moveBuf), "Moves: %d", moves); + DrawText(moveBuf, 10, 70, 20, DARKGRAY); + } break; } // ENDE GAMEPLAY DRAW