From ccd488e5324040ad00f426ff6a73da746ced75d9 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sat, 4 Oct 2025 07:58:56 +0200 Subject: [PATCH] porjectile: Added player check --- src/projectile.s | 17 +++++++++++++---- 1 file changed, 13 insertions(+), 4 deletions(-) diff --git a/src/projectile.s b/src/projectile.s index e193c47..4ebb924 100644 --- a/src/projectile.s +++ b/src/projectile.s @@ -32,13 +32,24 @@ act_spawn_projectile_pistol_player: ld a, PROJECTILE_F_PLAYER ld [hl], a - ret ; updates a simple pistol projectile ; inputs: ; de: actor ptr act_projectile_pistol_update: + ; is this a player actor? + ld hl, act_p0 + add hl, de + ld a, [hl] ; load projectile p0 flags + and a, PROJECTILE_F_PLAYER + jp nz, @player + + ; TODO: + ; enemy projectile logic + + ret +@player: ld hl, act_pos_y add hl, de @@ -52,7 +63,7 @@ act_projectile_pistol_update: ld b, a ld a, [hl] ld c, a ; c = x pos - + push de ld a, RF_PLAYER @@ -60,8 +71,6 @@ act_projectile_pistol_update: call actor_write_default_collider ; check enemy collision - ; TODO: if player projectile check enemies, otherwise - ; check player pop de push de -- 2.30.2