This tile indicate which actor is currently moving.
; bat actor
actor_update_bat:
actor_check_who
+ call z, draw_cursor
jr nz, @skip REL
; call state update
ld [anim_target_x], a
ret
+ ; draws cursor at the active actor's location
+ ; inputs:
+ ; bc: actor_ptr
+draw_cursor:
+ push_all
+
+ inc bc
+ ld a, [bc]
+ ld d, a ; d = y
+ inc bc
+ ld a, [bc]
+ ld e, a ; e = x
+
+@draw:
+ ; draw obj
+ ld hl, PLAYER_SPRITE1+12
+ ld a, d ; a = y
+ add a, OBJ_OFF_Y
+ ld [hl+], a
+
+ ld a, e ; a = x
+ add a, OBJ_OFF_X
+ ld [hl+], a
+
+ ld a, CURSOR_TILE
+ ld [hl+], a
+
+ xor a, a
+ ld [hl], a
+
+ pop_all
+
+ ret
+
; advance to the next actor if end_turn != 0
; effectively ending the current actor's turn
who_next:
; player gets 3 sprite slots in a row
.def int PLAYER_SPRITE1 = shadow_oam + 0
+.def int CURSOR_TILE = 0x04
+
.def int PLAYER_TILE_IDLE1 = 0x00
.def int PLAYER_TILE_IDLE2 = 0x12
ret
+player_draw_cursor:
+ push hl
+ push hl
+ pop bc
+ dec bc ; bc = fake player actor
+ call draw_cursor
+ pop hl
+ ret
+
; update the player
; players do not behave like regular actors
; and are not allocate to the regular
; update
ld a, [who]
cp a, WHO_PLAYER
+ call z, player_draw_cursor
jp nz, @skip_input
; call state update
.chr 00003333
.chr 00000000
; tile 4
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
-.chr 00000000
+.chr 11111100
+.chr 13333300
+.chr 13333300
+.chr 13300000
+.chr 13300000
+.chr 13300000
.chr 00000000
.chr 00000000
; tile 5