push de
; get location
call unit_get_pos
+
+ ld hl, act_rt_action_dat1
+ add hl, de ; hl = dat1
- ld de, act_rt_action_dat1
- add hl, de
- ; TODO determine where to draw animation
+ ; determine where to draw animation
ld a, [hl] ; a = direction pressed
+ cp a, DIRUP
+ jr nz, @not_up REL
+ dec b ; y--
+@not_up:
+
+ cp a, DIRDOWN
+ jr nz, @not_down REL
+ inc b ; y++
+@not_down:
+
+ cp a, DIRLEFT
+ jr nz, @not_left REL
+ dec c ; x--
+@not_left:
+
+ cp a, DIRRIGHT
+ jr nz, @not_right REL
+ inc c ; x++
+@not_right:
+
; draw a slash animation at that location
push bc