From: Lukas Krickl Date: Sat, 4 Oct 2025 05:58:56 +0000 (+0200) Subject: porjectile: Added player check X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=ccd488e5324040ad00f426ff6a73da746ced75d9;p=gbrg%2F.git porjectile: Added player check --- 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