From: Lukas Krickl Date: Sat, 1 Nov 2025 15:56:56 +0000 (+0100) Subject: player: cursor is now capped to map bounds X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=2bee5c3b38df8af5867f2a556bf5afae3e64bcca;p=gbrg%2F.git player: cursor is now capped to map bounds --- diff --git a/src/player.s b/src/player.s index a1b2713..1de61f6 100644 --- a/src/player.s +++ b/src/player.s @@ -24,6 +24,8 @@ move_cursor: input_held jr z, @not_down REL ld a, [player+act_pos_y] + cp a, 0xF0 ; max value + jr z, @not_down REL inc a ld [player+act_pos_y], a @not_down: @@ -32,6 +34,8 @@ move_cursor: input_held jr z, @not_up REL ld a, [player+act_pos_y] + cp a, 0 ; min value + jr z, @not_up REL dec a ld [player+act_pos_y], a @not_up: @@ -40,6 +44,8 @@ move_cursor: input_held jr z, @not_left REL ld a, [player+act_pos_x] + cp a, 0 ; min value + jr z, @not_left REL dec a ld [player+act_pos_x], a @not_left: @@ -48,6 +54,8 @@ move_cursor: input_held jr z, @not_right REL ld a, [player+act_pos_x] + cp a, 0xF0 ; max value + jr z, @not_right REL inc a ld [player+act_pos_x], a @not_right: