update: actors now do not render anymore when the path is blocked. origin/map-render-rework
authorLukas Krickl <lukas@krickl.dev>
Thu, 1 Jan 2026 16:32:11 +0000 (17:32 +0100)
committerLukas Krickl <lukas@krickl.dev>
Thu, 1 Jan 2026 16:32:11 +0000 (17:32 +0100)
src/player.s
src/update.s

index 697229706c52c175a82d9d9bc1bdb4b3b00035be..18b8e193bc777553fd95ef23dea32a156cb2ed3e 100644 (file)
@@ -84,6 +84,8 @@ player_attack:
        ; TODO: implement correctly
        ; for now just remove an actor if
        ; they are near
+
+       ; TODO: check if player can reach tile
        
        ld de, player
        map_load_march_vec dir_vector_forward
index 3dc92ec62945a80a6716bc5548e14d79c1928471..d763be2fbd1a43d2399b67e7ba87f4d55a5ebd66 100644 (file)
@@ -26,6 +26,7 @@ update_game_over:
        or a, e ; check if it is null
        call nz, act_draw_$2
        pop hl
+       push hl
        
        ; load t_prop
        ld de, t_prop
@@ -35,6 +36,15 @@ update_game_over:
        ld d, a
        or a, e ; check if it is null
        call nz, act_draw_$2
+
+       pop hl
+       ; check if we can go forward one more time
+       ; if not jump to @done_act_draw
+       ld de, t_flags0
+       ld b, [hl]
+       ld a, [dir_tf_forward]
+       and a, b
+       jp nz, @done_act_draw
 #endmacro
 
 update_game:
@@ -56,10 +66,11 @@ update_game:
        ; for the current frame
 update_game_draw_act_and_prop:
        ; TODO: update map routine
+
        _update_game_draw_act 0, near
        _update_game_draw_act 1, far
        _update_game_draw_act 2, furthest
-
+@done_act_draw:
   ret