Skip to content

Keep Snake rendering in sync on turns - #257

Merged
djeada merged 1 commit into
masterfrom
codex/fix-snake-turn-rendering
Nov 9, 2026
Merged

djeada merged 1 commit into
masterfrom
codex/fix-snake-turn-rendering

Conversation

@djeada

@djeada djeada commented Nov 9, 2026

Copy link
Copy Markdown
Owner

Changes

  • Finish any safe move the head has already started. The renderer and engine use the same direction until the head reaches the next grid corner, where queued turns take effect in order.
  • Remove the visual offset that could pull the head backward. Cap the duration of steps while a turn is queued to keep steering responsive.
  • Let a late turn away from a wall or obstacle start smoothly from the cell where the head is waiting.

Verification

  • The four turn-timing cases reproduced backward movement with the previous renderer and passed with the fix.
  • npm run test:games passed all 40 engine tests and 26 desktop and mobile-emulated browser tests using Chromium 149.
  • JavaScript syntax checks and git diff --check passed.

Finish a visible move before applying a queued turn. Share the active direction between rendering and the engine so both follow the same grid corner.
@netlify

netlify Bot commented Nov 9, 2026 •

Copy link
Copy Markdown

✅ Deploy Preview for goofy-brahmagupta-0a14f0 ready!

Name Link
🔨 Latest commit 9f1207b
🔍 Latest deploy log https://app.netlify.com/projects/goofy-brahmagupta-0a14f0/deploys/6af1e6be9c20a000ec6aac28
😎 Deploy Preview https://deploy-preview-257--goofy-brahmagupta-0a14f0.netlify.app
📱 Preview on mobile
Toggle QR Code...

QR Code

Use your smartphone camera to open QR code link.

To edit notification comments on pull requests, go to your Netlify project configuration.

@djeada
djeada merged commit 9b719fc into master Nov 9, 2026
6 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