diff --git a/Client/origin-client/scenes/game/game_screen.gd b/Client/origin-client/scenes/game/game_screen.gd index c3de1a6..cc8cfbe 100644 --- a/Client/origin-client/scenes/game/game_screen.gd +++ b/Client/origin-client/scenes/game/game_screen.gd @@ -130,8 +130,9 @@ var _pinch_dist : float = 0.0 # Prevents single-finger orbit from triggering during a pinch gesture even # if a ScreenDrag for finger-0 arrives before finger-1's ScreenTouch is processed. var _was_multi_touch : bool = false -var _touch_drag_active : bool = false # set when cumulative finger movement > threshold; suppresses tap-click -var _touch_drag_total : float = 0.0 # cumulative drag distance since last touch-down +var _touch_drag_active : bool = false # camera mode fired during this touch; suppresses tap-click +var _touch_drag_total : float = 0.0 # cumulative drag distance since last touch-down (gates camera actions) +var _touch_start_pos : Vector2 = Vector2.ZERO # finger position at touch-down (for start-to-end tap detection) # Touch camera mode — which camera action is currently active on touch var _touch_cam_orbit : bool = false # single-finger drag → orbit @@ -940,6 +941,7 @@ func _unhandled_input(event: InputEvent) -> void: # Single-touch start: arm tap + hold (touch right-click) behavior. _touch_drag_active = false _touch_drag_total = 0.0 + _touch_start_pos = st.position _press_was_on_board = true _last_mouse = st.position var touch_coord := _mouse_to_tile_coord(st.position) @@ -963,13 +965,18 @@ func _unhandled_input(event: InputEvent) -> void: var released_pos := st.position var had_single_touch := (_touch_points.size() == 1 and _touch_points.has(st.index)) _touch_points.erase(st.index) - if had_single_touch and not _touch_drag_active and not _was_multi_touch and _press_was_on_board: - _hold_timer.stop() - _handle_board_click(released_pos) + if had_single_touch and not _was_multi_touch and _press_was_on_board: + # Use start-to-end distance, not cumulative, to detect taps. + # Cumulative distance mis-classifies natural finger jitter (A→B→A) as a drag. + var tap_dist := released_pos.distance_to(_touch_start_pos) + if tap_dist < 50.0 and not _touch_drag_active: + _hold_timer.stop() + _handle_board_click(released_pos) if _touch_points.is_empty(): _was_multi_touch = false _touch_drag_active = false _touch_drag_total = 0.0 + _touch_start_pos = Vector2.ZERO _press_was_on_board = false _held_coord = Vector2i(-1, -1) _hold_timer.stop()