From e0c93dcc353cfb8a1c92111c725896940002e744 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Fri, 26 Sep 2025 18:58:47 +0200 Subject: [PATCH] player: Added cap for right and bottom of screen when moving --- src/player.s | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/src/player.s b/src/player.s index 25b245d..d0102a3 100644 --- a/src/player.s +++ b/src/player.s @@ -129,6 +129,12 @@ player_stage_move_p: jr nc, @no_overflow_y REL ld a, 0xFF @no_overflow_y: + + ; bottom of screen + cp a, 0x60 + jr c, @no_edge_y REL + ld a, 0x60 +@no_edge_y: ld b, a @@ -141,6 +147,13 @@ player_stage_move_p: jr nc, @no_overflow_x REL ld a, 0xFF @no_overflow_x: + + ; right side of screen + cp a, 0x90 + jr c, @no_edge_x REL + ld a, 0x90 +@no_edge_x: + ld c, a ret -- 2.30.2