video: Added despawn logic for actors going off-screen
authorLukas Krickl <lukas@krickl.dev>
Sat, 20 Sep 2025 17:49:21 +0000 (19:49 +0200)
committerLukas Krickl <lukas@krickl.dev>
Sat, 20 Sep 2025 17:49:21 +0000 (19:49 +0200)
src/video.s

index fc61a842fda4ada05f3ac3a41fc805fc2b24b95e..0aad5f00df3a8a4707e1c5922a9994a5ff445a98 100644 (file)
@@ -80,6 +80,14 @@ scroll_up_adjust:
        add a, 1
        ld [hl+], a ; hl = page y pos hi
        
+       ; check if off-screen
+       pop de
+       push de
+       push af
+       cp a, 0x70
+       call nc, actor_despawn
+       pop af
+       
        ld a, [hl]
        adc a, 0
        ld [hl], a