ui: wip adding ui elements
authorLukas Krickl <lukas@krickl.dev>
Wed, 15 Oct 2025 12:25:51 +0000 (14:25 +0200)
committerLukas Krickl <lukas@krickl.dev>
Wed, 15 Oct 2025 12:25:51 +0000 (14:25 +0200)
src/ui.s

index 4f2df7d5ec920c7a90e1fc5b75233d10b62544dd..86457d7917cafbe3e8046daa434466fb3bd3b5c8 100644 (file)
--- a/src/ui.s
+++ b/src/ui.s
@@ -3,13 +3,45 @@
 #define UI_TILE_MOVE 0xC0  
 #define UI_TILE_MOVE_USED 0xC1  
 
+#define UI_PLAYER_HP SCRN1+33
+#define UI_ENEMY_HP SCRN1+65
+
 ; one tile after 'Z'
 #define UI_WINDOW_BACKGROUND 0xF4  
 
-ui_str_clear:
-.str "                "
-.db 0
+strz str_player, "PLAYER"
+strz str_enemy, "ENEMY"
 
   ; inits UI
 ui_init:
+       call ui_draw_all
   ret
+       
+       ; draws the entire UI
+       ; only call during blank
+ui_draw_all:
+       call ui_draw_player_hp
+       call ui_draw_enemy_hp
+       ret
+       
+       ; draws player hp
+ui_draw_player_hp:
+       ld de, UI_PLAYER_HP
+       ld hl, str_player
+       call puts
+       ret
+
+       ; draws boss hp
+ui_draw_enemy_hp:
+       ld de, UI_ENEMY_HP
+       ld hl, str_enemy
+       call puts
+       ret
+       
+       ; draws current score
+ui_draw_score:
+       ret
+       
+       ; draws continues
+ui_draw_continues:
+       ret