Skip to content

fix: touch-only joystick and slide activation via double-tap jump - #60

Merged
theghost1980 merged 1 commit into
mainfrom
codex/fix-mobile-controls-and-slide-activation
Feb 8, 2026
Merged

theghost1980 merged 1 commit into
mainfrom
codex/fix-mobile-controls-and-slide-activation

Conversation

@saturnoTest

Copy link
Copy Markdown
Member

Motivation

  • Mobile joystick appeared on desktop due to a viewport-width fallback and double-tap slide on touch needed to only trigger when fish power is full while preserving keyboard behavior.

Description

  • Replace viewport-width fallback with a touch-only detection function (shouldUseMobileControls) that also checks pointer pointerType and returns false on non-touch pointers.
  • Add destroyMobileControls() and call it when mobile controls are not allowed to ensure joystick and touch jump UI are not created or are removed on resize.
  • Implement jump-button double-tap logic (MOBILE_JUMP_DOUBLE_TAP_WINDOW_MS, lastJumpTapTime, and handleJumpButtonTap) so a two-tap on the touch jump button activates activateSlideMax() only when fishPowerCount === FISH_MAX_POWER and slideActive is false, while single taps still perform a normal jump.
  • Remove the old touch-slide trigger logic that relied on joystick direction and the viewport-width fallback, and adjust resize/create flows to avoid creating touch UI on desktop.

Testing

  • Ran npm run typecheck and it completed successfully.
  • Ran npm run build and it completed successfully (build emitted a chunk-size warning only).

Codex Task

@saturnoTest
saturnoTest requested a review from a team February 8, 2026 01:52
@theghost1980
theghost1980 merged commit 3221522 into main Feb 8, 2026
1 check passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants