aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorMiquel Sabaté Solà <mssola@mssola.com>2026-03-05 18:49:42 +0100
committerMiquel Sabaté Solà <mssola@mssola.com>2026-03-05 18:49:42 +0100
commitae12e4a1e97f1bb3eea67047560296096af13bef (patch)
tree15830c2a1511ad6a4be07a2325f1b6f22a32ac58 /src
parent0de830d9ac786fbbf32e9abebf3975e909b1a5e7 (diff)
downloadjetpac.nes-ae12e4a1e97f1bb3eea67047560296096af13bef.tar.gz
jetpac.nes-ae12e4a1e97f1bb3eea67047560296096af13bef.zip
Don't be too tight on the player's feet for collision
Signed-off-by: Miquel Sabaté Solà <mssola@mssola.com>
Diffstat (limited to 'src')
-rw-r--r--src/enemies.s9
1 files changed, 6 insertions, 3 deletions
diff --git a/src/enemies.s b/src/enemies.s
index 0279958..281519d 100644
--- a/src/enemies.s
+++ b/src/enemies.s
@@ -207,7 +207,7 @@
inx
sta zp_enemies_pool_base, x
- ;; And point to the next enemy.
+ ;; Point to the next enemy.
inx
rts
@@ -244,7 +244,10 @@
ldx #0
;; Save the player's tile coordinates now as it will be useful/faster
- ;; for collision checking with each enemy.
+ ;; for collision checking with each enemy. Note that some of the values
+ ;; here are tuned down so the collision is not so aggresive (i.e. we
+ ;; don't want to consider the whole rectangle of the player, but a
+ ;; smaller area).
lda Player::zp_screen_y
tay
lsr
@@ -260,7 +263,7 @@
sta Enemies::zp_player_tile_waist
tya
clc
- adc #Player::PLAYER_HEIGHT
+ adc #(Player::PLAYER_WAIST + 2)
lsr
lsr
lsr