diff --git a/src/main.cpp b/src/main.cpp index 000aad8..faf5523 100644 --- a/src/main.cpp +++ b/src/main.cpp @@ -8,6 +8,9 @@ // ----------------------------------------------------------- int main() { + // Anzahl Spielzüge -> wie oft wurde ein Wuerfel geklickt + int turnCount = 0; + // Zufall initialisieren srand(time(NULL)); @@ -58,9 +61,12 @@ int main() // ----------------------------------------------------------- while (!WindowShouldClose()) { + + // Klick-Erkennung if (!gameWon && IsMouseButtonPressed(MOUSE_LEFT_BUTTON)) { + turnCount++; Vector2 mouse = GetMousePosition(); for (auto &c : cubes) @@ -123,15 +129,20 @@ int main() c.Draw(); EndMode3D(); - + if (gameWon) - DrawText("Congrats! You found all pairs!", 150, 260, 30, DARKBLUE); + { + DrawText("Congrats! You found all pairs!", 150, 260, 30, DARKBLUE); + DrawText(("TurnCount: " + std::to_string(turnCount)).c_str(), 150, 290, 20, DARKBLUE); + } else - DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY); - + { + DrawText("Flip 2 cubes - find matching pairs!", 10, 10, 20, DARKGRAY); + DrawText(("TurnCount: " + std::to_string(turnCount)).c_str(), 10, 30, 20, DARKGRAY); //Zeichne TurnCount + } EndDrawing(); } CloseWindow(); return 0; -} \ No newline at end of file +}