feat: exit menu with ESC to gameplay

This commit is contained in:
huaqo-games
2025-10-17 18:20:47 +02:00
parent 54b7dfbfd4
commit 3d304dcc7e
3 changed files with 14 additions and 5 deletions
+5
View File
@@ -121,6 +121,11 @@ void UpdateMenu(MenuState *m, State *state, Flags *flags)
state->currentView = GAMEPLAY;
}
if (IsKeyPressed(KEY_ESCAPE) && state->gameStarted)
{
state->currentView = GAMEPLAY;
}
if (isImageButtonClicked(&m->quitButton, m->sounds[HOVER_SOUND], m->sounds[CLICK_SOUND]) || (WindowShouldClose() && !IsKeyPressed(KEY_ESCAPE)))
{
state->running = false;