Skip to content

Darts: keep the two-line aim moving after a turn or a dialog - #375

Merged
margani merged 1 commit into
mainfrom
issue/374-darts-bars-still
Oct 20, 2026
Merged

margani merged 1 commit into
mainfrom
issue/374-darts-bars-still

Conversation

@margani

@margani margani commented Oct 20, 2026

Copy link
Copy Markdown
Contributor

Closes #374

Cause: the line's position follows the clock, but the canvas only redraws while the animation loop runs, and only kick() starts it. Nothing kicked it when a turn began, and a dialog ended the loop for good. On screen the line stood still; a tap stopped it where the clock said, somewhere else.

Fix: render() kicks the loop when it is a person's turn in two-line mode; the loop's condition (barsRun) no longer stops for dialogs. Taps under a dialog are still refused by canAim().

Proof (Playwright, canvas compared across 250 ms, local servers for this branch and for main)

main this branch
at game start still moves
after a full turn and the bot's turn still moves
after the help window closes still moves

So on main the line never moved on its own at all; the #373 run passed because every tap kicks the loop, and the line starts at a random point, so a still line was not seen. That check is now in the proof script, and tools/test.js guards the kick and the loop condition (fails on main's file, 4212 green here). browser-check: 36 of 36.

Not changed: at the start of a turn the status still shows the last turn's total ("This turn: 30") instead of the tap prompt, as it always did in drag mode.

🤖 Generated with Claude Code

https://claude.ai/code/session_01VoRrYWfb9CHLaEtJPXc4HH

The sweep position comes from the clock, but the canvas only redraws
while the animation loop runs, and only kick() starts it. Nothing kicked
it when a turn began (startTurn -> render), and a dialog made canAim()
false, which ended the loop for good. The line then stood still on
screen while barNow() ran on, so a tap stopped it somewhere else - the
owner's report on a phone right after #373.

render() now kicks the loop whenever it is a person's turn in two-line
mode, and the loop keeps running through dialogs (barsRun ignores the
scrim; taps are still refused there by canAim).

Co-Authored-By: Claude Opus 5.5 (1M context) <[email protected]>
Claude-Session: https://claude.ai/code/session_01VoRrYWfb9CHLaEtJPXc4HH
@margani

margani commented Oct 20, 2026

Copy link
Copy Markdown
Contributor Author

Diff review: two lines of logic. barsRun() mirrors barsOn() minus the dialog check, so the loop may draw under a dialog (one canvas, cheap) but cannot take input there. The kick sits at the end of render(), which every turn start, landing and restore goes through. Not tested: a real phone; the proof is headless Chrome.

@margani
margani merged commit b7bd7cf into main Oct 20, 2026
3 checks passed
@margani
margani deleted the issue/374-darts-bars-still branch October 20, 2026 05:15
@margani margani mentioned this pull request Oct 20, 2026
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.

Darts: the two-line aim stands still after the bot's turn, and a tap stops it somewhere else

1 participant