aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--.nasm/segments.txt2
-rw-r--r--src/enemies.s11
2 files changed, 10 insertions, 3 deletions
diff --git a/.nasm/segments.txt b/.nasm/segments.txt
index 03c9b6c..a53110b 100644
--- a/.nasm/segments.txt
+++ b/.nasm/segments.txt
@@ -1,4 +1,4 @@
- HEADER: 16/16 (100%)
-- ROM0: 5254/32762 (16.04%)
+- ROM0: 5260/32762 (16.06%)
- ROMV: 6/6 (100%)
- ROM2: 8192/8192 (100%)
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