; check all static rectangles
ld hl, rectangles
ld b, RECT_MAX
- ld de, r_size
@rect_test_loop:
+ push hl
+ push bc
call actor_test_rect
+ pop bc
+ pop hl
cp a, 0
jp nz, @rect_collision
@skip_rect:
+ ld de, r_size
add hl, de ; next rect (de = r_size)
dec b
jp nz, @rect_test_loop
@test_actor:
push de
push hl
+ push bc
ld de, act_rect
add hl, de ; hl = rectangle for actor
call actor_test_rect
cp a, 0
+ pop bc
pop hl
pop de
jp nz, @actor_collision
; returns:
; a: 1 collision
; a: 0 no collision
- ; preserves: all registers
actor_test_rect:
- push_all
; pre-filter rectangle mask
ld a, [tmp_rect_mask]
actor_test_movement_corner @rect_collision
@no_collision:
- pop_all
xor a, a
ret
@rect_collision:
- pop_all
ld a, 1
ret
#define NULL 0
-#define ACTS_PLAYER_PROJECTILES 3
+#define ACTS_PLAYER_PROJECTILES 6
#define ACTS_ENEMY 6
#define ACTS_ENEMY_PROJECTILES 6
#define ACTS_MAX (ACTS_PLAYER_PROJECTILES + ACTS_ENEMY + ACTS_ENEMY_PROJECTILES)