aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 16:49:17 +0530
committerAryadev Chavali <aryadev@aryadevchavali.com>2024-05-08 16:49:17 +0530
commitd0d61cbc1523986409eef734fd95d9ee018ab22a (patch)
treef445c041da952b3c0a26055ecce6dacbdd10a9f8
parent53ae6b99622163a7112548dfa82aeb592485a33a (diff)
downloadsnek-d0d61cbc1523986409eef734fd95d9ee018ab22a.tar.gz
snek-d0d61cbc1523986409eef734fd95d9ee018ab22a.tar.bz2
snek-d0d61cbc1523986409eef734fd95d9ee018ab22a.zip
Fixed bug where changing layout on game over would overflow timer
-rw-r--r--src/main.cpp6
1 files changed, 6 insertions, 0 deletions
diff --git a/src/main.cpp b/src/main.cpp
index d22360b..e3d69fb 100644
--- a/src/main.cpp
+++ b/src/main.cpp
@@ -420,16 +420,22 @@ int main(void)
{
state.layout = State<X, Y>::Layout::UNLIMITED;
state.reset();
+ time_start = Clock::now();
+ time_cur = time_start;
}
else if (IsKeyPressed(KEY_TWO))
{
state.layout = State<X, Y>::Layout::WALLS;
state.reset();
+ time_start = Clock::now();
+ time_cur = time_start;
}
else if (IsKeyPressed(KEY_THREE))
{
state.layout = State<X, Y>::Layout::WALLED_GARDEN;
state.reset();
+ time_start = Clock::now();
+ time_cur = time_start;
}
if (!paused && !failed)
{