From: Lukas Krickl Date: Fri, 26 Sep 2025 16:58:47 +0000 (+0200) Subject: player: Added cap for right and bottom of screen when moving X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=e0c93dcc353cfb8a1c92111c725896940002e744;p=gbrg%2F.git player: Added cap for right and bottom of screen when moving --- 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