From: Lukas Krickl Date: Sun, 25 Jan 2026 15:38:42 +0000 (+0100) Subject: player: Added b button action X-Git-Url: https://git.krickl.dev/?a=commitdiff_plain;h=refs%2Fremotes%2Forigin%2Fmaster;p=gbrg%2F.git player: Added b button action --- diff --git a/src/player.s b/src/player.s index 066b3a9..9914d53 100644 --- a/src/player.s +++ b/src/player.s @@ -175,13 +175,23 @@ player_load_target_tile: ; player perform action a player_do_action_a: call player_load_target_tile - call map_get_tile - + ld de, player ld a, [player_action_a] ld h, a ld a, [player_action_a+1] ld l, a jp action_exec + + + ; player perform action b +player_do_action_b: + call player_load_target_tile + ld de, player + ld a, [player_action_b] + ld h, a + ld a, [player_action_b+1] + ld l, a + jp action_exec ; moves the player ; does not move out of bounds @@ -189,10 +199,15 @@ player_do_action_a: player_handle_move: ld b, BTNA input_just - jr z, @not_attack REL - ld de, player + jr z, @not_action_a REL call player_do_action_a -@not_attack: +@not_action_a: + + ld b, BTNB + input_just + jr z, @not_action_b REL + call player_do_action_b +@not_action_b: ld b, DIRLEFT input_held