add hl, de ; hl + de
ret
- ; sets a tile position flag
- ; as a flag
- ; for actor -> actor collision detection
- ; inputs:
- ; a: the flag to set (flags | a)
- ; de: y/x
-room_set_flag:
- ld b, a
- call room_get_flag_ptr
- ld a, [hl]
- or a, b
- ld [hl], a
-
- ret
-
- ; unsets a tile position flag
- ; as a flag
- ; for actor -> actor collision detection
- ; inputs:
- ; a: the flag to set (flags ^ a)
- ; de: y/x
-room_unset_flag:
- ld b, a
- call room_get_flag_ptr
- ld a, [hl]
- xor a, b
- ld [hl], a
- ret
-
; gets flags at a certain position
; applies a mask
; inputs:
@no_anim:
; set collision mask
- ld a, RF_WALL | RF_DOOR
+ ld a, RF_WALL | RF_DOOR | RF_ACTOR
ld [ct_mask], a
; anim_target_y = y movement target
; need to look up the actor in question by
; iterating over the actor table + player
; and checking each position
- ; TODO: maybe add an actor lookup table for each tile
+ ; note: if RF_ACTOR is set the highest 4 bits of RF flags will
+ ; be set to the actor's id
.de RF_ACTOR, 4
; current room struct