player: Added b button action
authorLukas Krickl <lukas@krickl.dev>
Sun, 25 Jan 2026 15:38:42 +0000 (16:38 +0100)
committerLukas Krickl <lukas@krickl.dev>
Sun, 25 Jan 2026 15:38:42 +0000 (16:38 +0100)
src/player.s

index 066b3a94d7a682595e7e3528dd9eb067e5628ef5..9914d537d3207b321c7809ff73b1f8bbe34d616c 100644 (file)
@@ -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