From 5cd0f4112301fa0010fbf54fd0aa024d7044d5d0 Mon Sep 17 00:00:00 2001 From: jonny_l480 Date: Wed, 13 Dec 2023 17:40:54 +0100 Subject: [PATCH] Quit game when collided --- src/game.c | 4 ++-- src/menu.c | 2 ++ 2 files changed, 4 insertions(+), 2 deletions(-) diff --git a/src/game.c b/src/game.c index 7c899e9..48c9ca2 100644 --- a/src/game.c +++ b/src/game.c @@ -93,9 +93,9 @@ void runGameCycle() // TODO consider game.lifesRemaining and reset if still good? LOGI("game: collided with wall or self! => show leaderboard\n"); LOGI("DEBUG: collision currently disabled, game will continue in 1s...\n"); - DELAY(1000); + DELAY(800); //game.gameState = MENU; //TODO add config.collisionEnabled option? - //showLeaderboard(); + showLeaderboard(); return; } diff --git a/src/menu.c b/src/menu.c index 10f7183..a80ce9e 100644 --- a/src/menu.c +++ b/src/menu.c @@ -8,10 +8,12 @@ void showStartScreen(){ } void showLeaderboard(){ + game.gameState = EXIT; return; } void showPauseScreen(){ + game.gameState = PAUSED; return; }