player: Added debug hp output
authorLukas Krickl <lukas@krickl.dev>
Thu, 16 Oct 2025 04:59:30 +0000 (06:59 +0200)
committerLukas Krickl <lukas@krickl.dev>
Thu, 16 Oct 2025 04:59:30 +0000 (06:59 +0200)
src/map.s
src/player.s
src/ui.s

index fa7c30837f867ad59e179a4f7e822167d01168df..bdfb42060abf9c02848ccdfc992369e971fd3853 100644 (file)
--- a/src/map.s
+++ b/src/map.s
@@ -68,6 +68,7 @@ map_load:
 
 
        call map_page_full_draw
+       call player_init
        call ui_init
 
        ; initial scroll value 
@@ -75,7 +76,6 @@ map_load:
        ld a, 144
        ld [scroll_y], a
 
-       call player_init
        ret
        
        ; loads all tile banks 
index 4b512b4b256145a547c84aaafa080cb86181440d..debbaf7bbf3de75421d1f756bf5b56985250c28f 100644 (file)
@@ -12,6 +12,9 @@ player_init:
 
        ld a, 0x30 ; initial next scroll
        ld [player_next_scroll_y], a
+
+       ld a, 10
+       ld [player+act_hp], a
        ret
        
        ; updates the special player actor
index 86457d7917cafbe3e8046daa434466fb3bd3b5c8..3721c449d7b576e532a48ffd5fcf4632da651a94 100644 (file)
--- a/src/ui.s
+++ b/src/ui.s
@@ -29,6 +29,10 @@ ui_draw_player_hp:
        ld de, UI_PLAYER_HP
        ld hl, str_player
        call puts
+
+       ld de, UI_PLAYER_HP+7
+       ld a, [player+act_hp]
+       call putn
        ret
 
        ; draws boss hp