unit: Added stubs for movement code and scroll adjustmnets
authorLukas Krickl <lukas@krickl.dev>
Mon, 12 May 2025 10:09:13 +0000 (12:09 +0200)
committerLukas Krickl <lukas@krickl.dev>
Mon, 12 May 2025 10:09:13 +0000 (12:09 +0200)
src/unit.s

index 29b298fefa681ca1f5c8865fddaf254081f40f76..288de366be583bc526ee8512db73b0e9b1d2d57b 100644 (file)
@@ -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