From 35bdd44649caaa9ea1085c5fc9feb84d767f68c3 Mon Sep 17 00:00:00 2001 From: Vladimir nett00n Budylnikov Date: Sat, 27 Sep 2025 21:33:32 +0400 Subject: [PATCH] match3: improve tile selector --- scenes/game/gameplays/match3_gameplay.gd | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/scenes/game/gameplays/match3_gameplay.gd b/scenes/game/gameplays/match3_gameplay.gd index ef11a2c..46fa341 100644 --- a/scenes/game/gameplays/match3_gameplay.gd +++ b/scenes/game/gameplays/match3_gameplay.gd @@ -623,6 +623,12 @@ func _input(event: InputEvent) -> void: if current_state == GameState.SWAPPING or current_state == GameState.PROCESSING: return + # Handle action_east (B button/ESC) to deselect selected tile + if event.is_action_pressed("action_east") and current_state == GameState.SELECTING: + DebugManager.log_debug("action_east pressed - deselecting current tile", "Match3") + _deselect_tile() + return + # Handle keyboard/gamepad navigation if event.is_action_pressed("move_up"): _move_cursor(Vector2i.UP) @@ -825,7 +831,9 @@ func _are_adjacent(tile1: Node2D, tile2: Node2D) -> bool: func _attempt_swap(tile1: Node2D, tile2: Node2D) -> void: if not _are_adjacent(tile1, tile2): - DebugManager.log_debug("Tiles are not adjacent, cannot swap", "Match3") + DebugManager.log_debug("Tiles are not adjacent, selecting new tile instead", "Match3") + _deselect_tile() + _select_tile(tile2) return DebugManager.log_debug(