Puntestand einbauen
This commit is contained in:
parent
2fd3ee5870
commit
7bd8731cbb
13
src/main.cpp
13
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
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user