From 54bddc123bd59032815aac6c48f0c6cbba813e3d Mon Sep 17 00:00:00 2001 From: hangx-ma Date: Fri, 12 Jan 2024 17:28:53 +0800 Subject: [PATCH] fix: reset global config if restart the game, branch win --- include/dino/state.cpp | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/include/dino/state.cpp b/include/dino/state.cpp index 4c56bd5..5e47655 100644 --- a/include/dino/state.cpp +++ b/include/dino/state.cpp @@ -348,6 +348,10 @@ void GameState::reset() obstacle_.reset(); clouds_.reset(); score_.reset(); + // restore global config + render_cfg_.game_speed = 12; + render_cfg_.background_color = lgfx::colors::TFT_WHITE; + render_cfg_.prev_background_color = lgfx::colors::TFT_BLACK; } } // namespace dino \ No newline at end of file