Skip to content

fix: touch controls only on mobile and enable slide via jump+direction - #59

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

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

Conversation

@saturnoTest

Copy link
Copy Markdown
Member

Motivation

  • Prevent mobile UI from appearing on desktop by restricting joystick/jump button creation to true touch devices or small viewports.
  • Allow activating Slide Max on touch by combining a held directional input + jump when fishPower is full, matching desktop double-tap slide behavior without changing keyboard controls.
  • Keep the change small and confined to input/UI code and preserve existing gameplay outside the new mobile activation path.

Description

  • Limit mobile controls in shouldUseMobileControls to this.sys.game.device.input.touch === true || viewportWidth < 700 so joystick and touch jump are only created on touch/small screens.
  • Remove desktop pointer-based movement handlers and ensure joystick and jump button are only created when mobileControlsEnabled is true.
  • Add joystickStrength and lastMoveDirectionChangeTime plus constants MOBILE_SLIDE_TRIGGER_DEADZONE and MOBILE_SLIDE_STABLE_MS, and update updateJoystick/resetJoystick to track direction strength and stability.
  • Change tryJump to accept options: { fromTouch?: boolean }, call it from the touch jump hitbox with { fromTouch: true }, and add shouldTriggerTouchSlideMax() to trigger activateSlideMax() only when fishPowerCount === FISH_MAX_POWER and the directional input passes deadzone or stability checks.

Testing

  • Ran npm run typecheck and it completed successfully.
  • Ran npm run build and the production build completed successfully.

Codex Task

@saturnoTest
saturnoTest requested a review from a team February 8, 2026 01:40
@theghost1980
theghost1980 merged commit a0cadf1 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