Skip to content

refactor(components/game/engine): replace deprecated 'THREE.Clock' with 'THREE.Timer' - #1629

Merged
sukvvon merged 3 commits into
mainfrom
refactor/game-engine-three-timer
Nov 23, 2026
Merged

sukvvon merged 3 commits into
mainfrom
refactor/game-engine-three-timer

Conversation

@sukvvon

@sukvvon sukvvon commented Nov 23, 2026

Copy link
Copy Markdown
Member

Summary

THREE.Clock is deprecated in three (Please use THREE.Timer instead). This switches GameEngine to THREE.Timer:

  • start() calls timer.reset(), so the first frame's delta is measured from the start of the loop rather than from when the engine was constructed (which happens before init() loads models).
  • Each frame calls timer.update() and then reads getDelta() / getElapsed().
  • On visibilitychange back to visible, timer.update() replaces clock.getDelta(), so the hidden time is consumed before the next frame and the boat does not jump.

Verification

  • tsc and oxlint pass; typescript/no-deprecated no longer reports GameEngine.ts.
  • Local dev, /explore: holding W accelerates the boat smoothly to a steady 12.5 units/s and it decelerates on release.
  • With W held, simulating a 3-second hidden tab and returning moves the boat 0.68 then 1.25 per 100ms sample, with no jump.
  • No console errors.

@sukvvon sukvvon self-assigned this Nov 23, 2026
@changeset-bot

changeset-bot Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

⚠️ No Changeset found

Latest commit: ccbc625

Merging this PR will not cause a version bump for any packages. If these changes should not result in a new version, you're good to go. If these changes should result in a version bump, you need to add a changeset.

Click here to learn what changesets are, and how to add one.

Click here if you're a maintainer who wants to add a changeset to this PR

@coderabbitai

coderabbitai Bot commented Nov 23, 2026 •

Copy link
Copy Markdown

Explain Change →

Warning

Review limit reached

You've used all free OSS reviews for now. Wait for the free limit to reset to keep reviewing this public repository.

Next included review available in 55 minutes.

Check out review usage here.

View limit details

Limit details: You’ve used all 4 included reviews currently available.

Learn how review limits work.

Review configuration:

Run configuration

  • Source mode: Auto
  • Repository: Unavailable
  • Branch: Unavailable
  • File: No configuration file from this repository applied
  • Commit: Unavailable
  • Layers: defaults
  • Review profile: CHILL
  • Plan: Advanced
  • Run ID: 4f9382df-c860-469f-bc68-b153b7b10d8e
Commits

Reviewing files that changed from the base of the PR and between b64bef2 and ccbc625.

Files selected for processing: 1

  • src/components/game/engine/GameEngine.ts
Finishing Touches

Generate unit tests (beta)

  • Commit to this branch
  • Create a new PR
  • Autofix · Keep fixing CodeRabbit findings and required CI, and resolving merge conflicts

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

@github-actions

Copy link
Copy Markdown
Asset Main PR merge build Change
JavaScript 19580.39 KiB 19580.94 KiB 🔴 +0.55 KiB (+0.00%)
JavaScript (gzip) 6443.74 KiB 6443.57 KiB 🟢 -0.17 KiB (-0.00%)
CSS 823.32 KiB 823.32 KiB 0.00 KiB (0.00%)
CSS (gzip) 126.01 KiB 126.01 KiB 0.00 KiB (0.00%)
Page Main (gzip) PR merge build (gzip) Change
/ 595.03 KiB 594.99 KiB 🟢 -0.04 KiB (-0.01%)
/libraries 537.88 KiB 537.86 KiB 🟢 -0.02 KiB (-0.00%)
/start/latest 562.67 KiB 562.64 KiB 🟢 -0.03 KiB (-0.01%)
/router/latest 562.97 KiB 562.94 KiB 🟢 -0.03 KiB (-0.01%)
/query/latest 561.42 KiB 561.39 KiB 🟢 -0.03 KiB (-0.01%)
/table/latest 594.23 KiB 594.20 KiB 🟢 -0.03 KiB (-0.01%)
/charts/latest 643.53 KiB 643.50 KiB 🟢 -0.03 KiB (-0.00%)
/ai/latest 588.35 KiB 588.31 KiB 🟢 -0.04 KiB (-0.01%)
Docs article 548.94 KiB 548.91 KiB 🟢 -0.03 KiB (-0.01%)
Framework docs article 548.94 KiB 548.91 KiB 🟢 -0.03 KiB (-0.00%)
/blog 542.09 KiB 542.06 KiB 🟢 -0.03 KiB (-0.01%)
/maintainers 541.19 KiB 541.16 KiB 🟢 -0.03 KiB (-0.01%)
/showcase 539.14 KiB 539.11 KiB 🟢 -0.03 KiB (-0.01%)
/chat 537.61 KiB 537.59 KiB 🟢 -0.02 KiB (-0.00%)
/chat/c/:conversationId 538.33 KiB 538.30 KiB 🟢 -0.03 KiB (-0.00%)

Page sizes sum the JS and CSS in the TanStack Start manifest for each route and its layouts. Shared files count once per page.

Compared with main at b64bef2. Gzip sizes are summed per file. Build run

@sukvvon
sukvvon merged commit 23fef4d into main Nov 23, 2026
11 checks passed
@sukvvon
sukvvon deleted the refactor/game-engine-three-timer branch November 23, 2026 18:00
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