ld a, RF_PLAYER
ld hl, tmp_rect
- call actor_write_default_collider
+ call actor_projectile_write_default_collider
; check enemy collision
pop de
; bc: projectile
act_projectile_pistol_col_res:
ret
+
+
+ ; writes actor default projectile collider
+ ; based on an input position
+ ; writes the collider to dst
+ ; e.g. use with actor's real rectangle
+ ; if real collision should be written
+ ; use with tmp_rect for collision tests before moving
+ ; inputs:
+ ; a: collision mask
+ ; b/c: y/x position of actor
+ ; hl: destination rectangle
+actor_projectile_write_default_collider:
+ ld [hl+], a ; mask
+ ld a, b
+ add a, 4
+ ld [hl+], a ; y pos
+
+ ld a, c
+ add a, 2
+ ld [hl+], a ; x pos
+
+ ld a, 4 ; width/height
+ ld [hl+], a ; height
+
+ ld [hl+], a ; width
+ ret