From b701e5fc34351a727a217542c60f22beda7681e7 Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 16 Mar 2026 22:06:17 +0100 Subject: Improve the accuracy of the dropping zone MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit We were abusing on tile collision for this, and it wasn't exact. Not only that, but if the player was fast enough, sometimes the item wouldn't drop as the accelaration would pass through that zone. Avoid that by simply using regular screen coordinates, which aren't too hard to check in this case. Signed-off-by: Miquel Sabaté Solà --- .nasm/segments.txt | 2 +- src/items.s | 16 +++++++--------- 2 files changed, 8 insertions(+), 10 deletions(-) diff --git a/.nasm/segments.txt b/.nasm/segments.txt index 7d74792..7ba06cb 100644 --- a/.nasm/segments.txt +++ b/.nasm/segments.txt @@ -1,4 +1,4 @@ - HEADER: 16/16 (100%) -- ROM0: 8030/32762 (24.51%) +- ROM0: 8034/32762 (24.52%) - ROMV: 6/6 (100%) - ROM2: 8192/8192 (100%) diff --git a/src/items.s b/src/items.s index e1ebed6..7d22828 100644 --- a/src/items.s +++ b/src/items.s @@ -61,12 +61,8 @@ ;; Number of shuttle parts (or fuel tanks) that have been collected so far. zp_collected = $CB - ;; Coordinate where the dropping of items takes place. This comes in two - ;; versions, as the "collision" is done in the tile coordinates so to give - ;; some leeway to the player; but the dropping itself has to fall from the - ;; exact screen coordinates or otherwise the dropping would feel weird.z + ;; Coordinate where the dropping of items takes place. DROPPING_SCREEN_X = $A8 - DROPPING_TILE_X = $15 ;; Y screen coordinates in order for various parts to be considered as ;; "collected". @@ -390,10 +386,12 @@ sta Items::zp_pool_base + 2, x ;; Are we at the zone where we must drop items? - ldy Globals::zp_arg1 - dey - cpy #DROPPING_TILE_X - beq @drop + cmp #DROPPING_SCREEN_X - 8 + bcs @may_drop + jmp @next + @may_drop: + cmp #DROPPING_SCREEN_X + 8 + bcc @drop jmp @next @drop: -- cgit v1.2.3