From 8bade1d452d1634e75641646cfc6b10a3da839d9 Mon Sep 17 00:00:00 2001 From: Lukas Krickl Date: Sun, 25 Jan 2026 16:38:42 +0100 Subject: [PATCH] player: Added b button action --- src/player.s | 25 ++++++++++++++++++++----- 1 file changed, 20 insertions(+), 5 deletions(-) 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 -- 2.30.2