ui: Fixed player hp display when entering hard mode
authorLukas Krickl <lukas@krickl.dev>
Sun, 26 Oct 2025 04:31:00 +0000 (05:31 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 26 Oct 2025 04:31:00 +0000 (05:31 +0100)
src/ui.s

index 7760062542f7eff1b67ea0b64b5db3fa593bae90..3aee7566cabd7e8a5035c77201029075b6fce746 100644 (file)
--- a/src/ui.s
+++ b/src/ui.s
@@ -26,10 +26,20 @@ ui_init:
        ; draws the entire UI
        ; only call during blank
 ui_draw_all:
+       call ui_clear_player_hp
        call ui_draw_player_hp
        call ui_draw_enemy_hp
        ret
        
+       ; clears player hp
+ui_clear_player_hp:
+       ld hl, UI_PLAYER_HP+7
+       ld a, UI_WINDOW_BACKGROUND
+       
+.rep i, 8, 1, ld [hl+], a
+
+       ret
+       
        ; draws player hp
 ui_draw_player_hp:
        ld de, UI_PLAYER_HP
@@ -69,6 +79,11 @@ ui_draw_hp:
        ld [hl+], a
 
 @done:
+       
+       ; clear the next index
+       ld a, UI_WINDOW_BACKGROUND
+       ld [hl+], a
+
        ret
 
        ; draws boss hp