From 3b238d047207441a9ed4c3ae503f323e04b62bef Mon Sep 17 00:00:00 2001 From: Miquel Sabaté Solà Date: Mon, 16 Mar 2026 22:04:19 +0100 Subject: Wait for items to fall before changing screen MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit More specifically, whenever the player dies and we need to reset the screen, wait for items to fall in the same way as we do for explosions to disappear. This also brought with it some other changes like removing sprite reset on screen initialization. Signed-off-by: Miquel Sabaté Solà --- src/driver.s | 28 ++++++++++++++++++---------- 1 file changed, 18 insertions(+), 10 deletions(-) (limited to 'src/driver.s') diff --git a/src/driver.s b/src/driver.s index 448efa2..f747c4b 100644 --- a/src/driver.s +++ b/src/driver.s @@ -161,15 +161,6 @@ dey bne @bullets_reset_loop - ;; Invalidate all items. - ldx #0 - ldy #Items::POOL_CAPACITY - @items_reset_loop: - sta Items::zp_pool_base, x - NEXT_ITEM_INDEX_X - dey - bne @items_reset_loop - ;; Set that we have done this operation so it's not done in future ;; cycles. lda Driver::zp_flags @@ -324,7 +315,12 @@ lda Explosions::zp_active bne @sprite_cycling - ;; After all the explosions have been done, is any player alive? + ;; Are there still falling items? + lda Items::zp_state + and #$03 + bne @sprite_cycling + + ;; After all the explosions/items have been done, is any player alive? lda Globals::zp_multiplayer and #%00000110 bne @reset_timer @@ -335,6 +331,18 @@ ora #%00000010 sta Globals::zp_flags + ;; Invalidate items, which were skipped on move_sprites_out() on purpose + ;; to keep them after each death. But since we are about to go to the + ;; title screen, now they are no longer useful. + lda #$FF + ldx #0 + ldy #Items::POOL_CAPACITY + @items_reset_loop: + sta Items::zp_pool_base, x + NEXT_ITEM_INDEX_X + dey + bne @items_reset_loop + @reset_timer: ;; Reset the player's timer to enter the game screen again. lda #PLAYER_TIMER_VALUE -- cgit v1.2.3