Fixed bug where changing layout on game over would overflow timer

This commit is contained in:
2024-05-08 16:49:17 +05:30
parent 53ae6b9962
commit d0d61cbc15

View File

@@ -420,16 +420,22 @@ int main(void)
{ {
state.layout = State<X, Y>::Layout::UNLIMITED; state.layout = State<X, Y>::Layout::UNLIMITED;
state.reset(); state.reset();
time_start = Clock::now();
time_cur = time_start;
} }
else if (IsKeyPressed(KEY_TWO)) else if (IsKeyPressed(KEY_TWO))
{ {
state.layout = State<X, Y>::Layout::WALLS; state.layout = State<X, Y>::Layout::WALLS;
state.reset(); state.reset();
time_start = Clock::now();
time_cur = time_start;
} }
else if (IsKeyPressed(KEY_THREE)) else if (IsKeyPressed(KEY_THREE))
{ {
state.layout = State<X, Y>::Layout::WALLED_GARDEN; state.layout = State<X, Y>::Layout::WALLED_GARDEN;
state.reset(); state.reset();
time_start = Clock::now();
time_cur = time_start;
} }
if (!paused && !failed) if (!paused && !failed)
{ {