From: Lukas Krickl Date: Mon, 12 May 2025 10:09:13 +0000 (+0200) Subject: unit: Added stubs for movement code and scroll adjustmnets X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=9535bae607c7c6e256d4bb49cb34f077a8849b10;p=gbrg%2F.git unit: Added stubs for movement code and scroll adjustmnets --- 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