Repository navigation
refactor(components/game/engine): replace deprecated 'THREE.Clock' with 'THREE.Timer' - #1629
Conversation
|
|
Warning Review limit reachedYou'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. View limit details
Finishing Touches
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. |
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 |
Summary
THREE.Clockis deprecated in three (Please use THREE.Timer instead). This switchesGameEnginetoTHREE.Timer:start()callstimer.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 beforeinit()loads models).timer.update()and then readsgetDelta()/getElapsed().visibilitychangeback to visible,timer.update()replacesclock.getDelta(), so the hidden time is consumed before the next frame and the boat does not jump.Verification
tscandoxlintpass;typescript/no-deprecatedno longer reportsGameEngine.ts./explore: holdingWaccelerates the boat smoothly to a steady 12.5 units/s and it decelerates on release.Wheld, simulating a 3-second hidden tab and returning moves the boat 0.68 then 1.25 per 100ms sample, with no jump.