Skip to content

Vessel Surfer: mouse drag joystick on computers, U-turn about a fixed axis - #82

Merged
stebo85 merged 3 commits into
mainfrom
t3code/surf-mouse-joystick
Sep 20, 2026
Merged

stebo85 merged 3 commits into
mainfrom
t3code/surf-mouse-joystick

Conversation

@stebo85

@stebo85 stebo85 commented Sep 20, 2026

Copy link
Copy Markdown
Contributor

The mouse control requested after #75, plus a U-turn fix found while testing it. (This commit was pushed to the #81 branch just after that PR was merged, so it did not ship with it.)

Mouse drag joystick. On a computer, click and hold anywhere to raise the floating joystick under the pointer and drag to steer, the same control a phone uses without motion sensors. A resting or moving pointer still never steers, so the speed slider and buttons stay reachable.

U-turn. Each yaw step rotated about the camera's up vector while the levelling logic rolled that vector, so a 180° sweep from a pitched or rolled heading ended short of backwards. It now rotates about the up axis captured when the turn starts and skips levelling while turning.

Verification. All 30 unit tests and 10 browser tests pass. The desktop spec checks that a moving mouse does not steer, that a held drag does, and that the U-turn ends facing backwards.

🤖 Generated with Claude Code

Summary by CodeRabbit

  • New Features
    • Desktop players can now click and drag anywhere to steer with a floating joystick. Releasing the mouse flies straight, and simply moving or resting the pointer does not steer.
  • Bug Fixes
    • U-turns now consistently finish facing directly backward, regardless of the vessel’s initial pitch or roll.
  • Documentation
    • Updated in-game help and computer-control documentation to explain mouse steering and the revised behavior.

stebo85 and others added 3 commits September 20, 2026 02:44
… axis

Click and hold anywhere to raise the floating joystick under the pointer and
drag to steer, as on a phone without motion sensors; a resting or moving
pointer still never steers, so the controls stay reachable. The U-turn now
rotates about the up axis captured when it starts and skips levelling while
turning, so it ends facing exactly backwards from a pitched or rolled heading.

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@coderabbitai

coderabbitai Bot commented Sep 20, 2026

Copy link
Copy Markdown

Review Change StackReview Change Stack

No actionable comments were generated in the recent review. 🎉

ℹ️ Recent review info
⚙️ Run configuration

Configuration used: defaults

Review profile: CHILL

Plan: Advanced

Run ID: 42afbe5e-15fb-499f-86ee-4eb70f933ec9

📥 Commits

Reviewing files that changed from the base of the PR and between ea5d1f8 and 324ed30.

📒 Files selected for processing (6)
  • site/easter-eggs/vessel-surfer/CHANGELOG.md
  • site/easter-eggs/vessel-surfer/README.md
  • site/easter-eggs/vessel-surfer/e2e/controls.spec.js
  • site/easter-eggs/vessel-surfer/index.html
  • site/easter-eggs/vessel-surfer/package.json
  • site/easter-eggs/vessel-surfer/src/main.js

Included review availability: Your plan provides up to 1 included review per hour; 0 remain after this review.


📝 Walkthrough

Walkthrough

The Vessel Surfer now supports held mouse-drag steering on computers. U-turns rotate around the up axis captured at turn start. Documentation, browser tests, and the package version reflect these changes.

Changes

Vessel Surfer controls

Layer / File(s) Summary
Desktop drag steering
site/easter-eggs/vessel-surfer/src/main.js, site/easter-eggs/vessel-surfer/index.html, site/easter-eggs/vessel-surfer/README.md, site/easter-eggs/vessel-surfer/e2e/controls.spec.js
Left-button pointer input now starts joystick steering. A held drag changes heading, while a resting or moving pointer does not. Control text and browser tests describe and verify this behavior.
Fixed-axis U-turn
site/easter-eggs/vessel-surfer/src/main.js, site/easter-eggs/vessel-surfer/e2e/controls.spec.js, site/easter-eggs/vessel-surfer/CHANGELOG.md, site/easter-eggs/vessel-surfer/package.json
U-turns capture swimUp and rotate direction around that axis. The test stabilizes the baseline with Shift braking and verifies reversal. The changelog and package version were updated.

Priority: ⬇️ Low

Estimated code review effort: 3 (Moderate) | ~20 minutes

Change: Feature

Sequence Diagram(s)

sequenceDiagram
  participant Browser
  participant CanvasPointerHandler
  participant Joystick
  participant RenderLoop
  Browser->>CanvasPointerHandler: press and hold left mouse button
  CanvasPointerHandler->>Joystick: show joystick at pointer
  Joystick->>RenderLoop: provide drag steering
  RenderLoop->>Browser: update vessel heading
Loading
🚥 Pre-merge checks | ✅ 4 | ❌ 1

❌ Failed checks (1 warning)

Check name Status Explanation Resolution
Docstring Coverage ⚠️ Warning Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4… Write docstrings for the functions missing them to satisfy the coverage threshold.
✅ Passed checks (4 passed)
Check name Status Explanation
Description Check ✅ Passed Check skipped - CodeRabbit’s high-level summary is enabled.
Title check ✅ Passed The title clearly and concisely identifies both main changes: computer mouse-drag joystick control and fixed-axis U-turn behavior.
Linked Issues check ✅ Passed Check skipped because no linked issues were found for this pull request.
Out of Scope Changes check ✅ Passed Check skipped because no linked issues were found for this pull request.
Full details: Docstring Coverage

Explanation

Docstring coverage is 50.00% which is insufficient. The required threshold is 80.00%. Docstring coverage is scoped to functions touched by this diff. Analyzed 2 functions across 2 files. (4 skipped: 4 unsupported.)

  • Fix all pre-merge checks with AI
✨ Finishing Touches 💡 1
📝 Generate docstrings 💡
  • Commit to this branch
  • Create a new PR
🧪 Generate unit tests (beta)
  • Commit to this branch
  • Create a new PR

Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out.

❤️ Share

Comment @coderabbitai help to get the list of available commands.

@stebo85
stebo85 merged commit d715b9d into main Sep 20, 2026
10 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant