From 8ca1cdc42c61dcd2796e7a067bee235599f4e065 Mon Sep 17 00:00:00 2001 From: Layla Marchant Date: Fri, 25 Dec 2020 20:06:41 -0500 Subject: [PATCH] Made it so that the game doesn't go unresponsive, made credits recenter There was a period of time just after the defeat of Kline that the game wasn't responding to input, causing the OS to panic. Corrected this, and also made it so that resizing the window adjusts the positioning of the credits appropriately. --- src/game.c | 1 + src/title.c | 7 +++++++ 2 files changed, 8 insertions(+) diff --git a/src/game.c b/src/game.c index c029798..6ad2486 100644 --- a/src/game.c +++ b/src/game.c @@ -2706,6 +2706,7 @@ int game_mainLoop() else if ((game.area == MISN_VENUS) && (engine.musicVolume > 0)) { + player_getInput(); engine.keyState[KEY_UP] = 0; engine.keyState[KEY_DOWN] = 0; engine.keyState[KEY_LEFT] = 0; diff --git a/src/title.c b/src/title.c index 45ca337..8fcee86 100644 --- a/src/title.c +++ b/src/title.c @@ -698,6 +698,13 @@ void title_showCredits() if (engine.keyState[KEY_ESCAPE] || engine.keyState[KEY_FIRE] || engine.keyState[KEY_ALTFIRE]) break; + + // Check to see if we need to reposition credits + if (credit[0].x != (screen->w - credit[0].image->w) / 2) { + for (i=0; i< nCredit; i++) { + credit[i].x = (screen->w - credit[i].image->w) / 2; + } + } float speed = 0.5; if (engine.keyState[KEY_DOWN])