aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-01 23:14:58 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-01 23:14:58 +0100
commit8b8a5c028e3b9d56ad018aba582cc81e66c45a15 (patch)
treec16d4f7a88996030d98e6ff73cd1063e69e4eaf4 /src
parentc9e7a7ab06732f5e9fb0cde1cd01f46d059b0259 (diff)
downloadjetpac.nes-8b8a5c028e3b9d56ad018aba582cc81e66c45a15.tar.gz
jetpac.nes-8b8a5c028e3b9d56ad018aba582cc81e66c45a15.zip
Fix bottom collision for fighter jet 1s
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
-rw-r--r--src/enemies.s11
1 files changed, 9 insertions, 2 deletions
diff --git a/src/enemies.s b/src/enemies.s
index f69e9fd..9bda83d 100644
--- a/src/enemies.s
+++ b/src/enemies.s
@@ -545,10 +545,17 @@
JAL bite_the_dust
@check_down:
- ;; If that failed, then increment the vertical tile coordinate twice to
- ;; get the bottom boundary and check again.
+ ;; If that failed, then increment the vertical tile coordinate to get
+ ;; the bottom boundary and check again. Note that the "bottom" is
+ ;; different if it's the regular 'basic' enemy or it's the fighter jet
+ ;; re-using this algorithm. That's why if the level kind is 3 the bottom
+ ;; is increased by one and not twice.
inc Globals::zp_arg0
+ ldy Globals::zp_level_kind
+ cpy #3
+ beq @skip_second_inc
inc Globals::zp_arg0
+ @skip_second_inc:
jsr Background::collides
beq @end
JAL bite_the_dust