From d9f32cdf8c1d8bd04c74ea9520bb5ad6b68c5f37 Mon Sep 17 00:00:00 2001 From: Svjatoslav Agejenko Date: Thu, 21 Aug 2025 20:21:17 +0300 Subject: [PATCH] Better code readability --- Games/Pomppu Paavo.bas | 21 +++++++++++++++++++-- 1 file changed, 19 insertions(+), 2 deletions(-) diff --git a/Games/Pomppu Paavo.bas b/Games/Pomppu Paavo.bas index bf18cf3..628fcc1 100755 --- a/Games/Pomppu Paavo.bas +++ b/Games/Pomppu Paavo.bas @@ -440,13 +440,30 @@ IF sipa = 3 THEN sipa = 1 GOTO 106 SUB DisplayGameStatistics +' +' Updates and displays the game's status information (coins collected, lives remaining) +' Handles game over condition when lives reach zero. +' +' This subroutine is called whenever the game state changes that affects statistics: +' - When a coin is collected +' - When the player loses a life +' - Periodically during gameplay + LOCATE 1, 1 -IF graphicsMode = 2 THEN GOTO 12 +IF GraphicsMode% = 2 THEN GOTO SkipTextDisplay + +' Clear previous stats display PRINT " " + +' Award extra life every 10 coins collected IF CoinsCollected% > 9 THEN CoinsCollected% = 0: LivesRemaining% = LivesRemaining% + 1 + +' Display current game statistics LOCATE 1, 1 PRINT "o "; CoinsCollected%; " Lives "; LivesRemaining% -12 + +SkipTextDisplay: +' Check if player has run out of lives IF LivesRemaining% < 0 THEN END END SUB -- 2.20.1