From 9535bae607c7c6e256d4bb49cb34f077a8849b10 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Mon, 12 May 2025 12:09:13 +0200 Subject: [PATCH] unit: Added stubs for movement code and scroll adjustmnets --- src/unit.s | 23 +++++++++++++++++++++-- 1 file changed, 21 insertions(+), 2 deletions(-) diff --git a/src/unit.s b/src/unit.s index 29b298f..288de36 100644 --- a/src/unit.s +++ b/src/unit.s @@ -121,13 +121,32 @@ unit_handle_inputs: input_held BTNUP jr z, @notup REL - ; call unit_try_abort_move_up - ; call scroll_center + call unit_try_move_up @notup: ldnull bc ret + ; moves a unit up + ; moves are aborted + ; if no more initiative is left + ; a wall is hit, another unit is hit + ; or the edge of the map is hit + ; inputs: + ; de: actor + ; updates: + ; actor initiative based on tile flags + ; actor position +unit_try_move_up: + ret + + ; centers the current scroll on the selected unit + ; snaps to corners of the map + ; inputs: + ; de: actor +unit_scroll_center: + ret + unit_demo_1: st_def 0x00, unit_demo_1_init, st_unit_demo_1_update act_def ACT_T_DEMO_1, 0, 1, 1, 1, 1, 1, 2, 2, 0 -- 2.30.2