; last collision with actor
; set during unit_collision_woth_any_other
.de act_rt_collided_with, 2
-.de act_rt_subtile_y, 1
-.de act_rt_subtile_x, 1
+
+ ; sub-tile drawing vars
+ ; during this animation the actor is already technically in its new
+ ; location.
+ ; ab000000: direction bits (a == 0/1 -> up/down; b == 0/1 -> left/right)
+ ; 00nnn000: current tile offset y position
+ ; 00000nnn: currnet tile offset x position
+.de act_rt_sub_tile, 1
; stats1
.de act_level, 1
; to a movement animation
; the animation time is dependant on movement
; speed (100-stat_calc_speed)
+ ; the end-state of the move_animation should
+ ; clear rt_sub_tile to 0
; inputs:
; de: actor
+ ; a: mask for rt_sub_tile
+ ; rt_subtile |= a
unit_transition_to_move_animation:
ret
dec a
ld [hl], a
-
+
+ ; not bits set
+ ld a, 0b00000000
call unit_transition_to_move_animation
ret
inc a
ld [hl], a
+ ; set down bit
+ ld a, 0b10000000
call unit_transition_to_move_animation
ret
dec a
ld [hl], a
+ ; no bits set
+ ld a, 0b00000000
call unit_transition_to_move_animation
ret
inc a
ld [hl], a
+ ; set right bit
+ ld a, 0b01000000
call unit_transition_to_move_animation
ret