Skip to content

Fast Piggie: add 15ms pre-flash gap before image reveal#112

Merged
acrosman merged 3 commits into
mainfrom
copilot/hit-fast-piggie-selection-wedges-sooner
May 29, 2026
Merged

Fast Piggie: add 15ms pre-flash gap before image reveal#112
acrosman merged 3 commits into
mainfrom
copilot/hit-fast-piggie-selection-wedges-sooner

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented May 29, 2026

At high speeds, Fast Piggie wedge visuals could still be present when the next image flash began, making selection cues overlap with the stimulus. This change introduces a small pre-flash separation so wedges disappear before images are shown.

  • Timing behavior

    • Added a 15ms lead-in between board clear (wedges-only state) and image flash start.
    • _runRound() now clears the board first, then schedules image draw after the lead-in.
  • Timer lifecycle safety

    • Split timer responsibilities into:
      • pre-flash delay timer
      • image display-duration timer
    • Updated stop() and reset() to clear both timers, preventing in-flight callbacks during transitions.
  • Focused coverage

    • Added a timing-sequence test to verify:
      • first timeout is scheduled for 15ms
      • post-delay timeout is scheduled for the mocked round display duration
clearImages(_ctx, width, height, wedgeCount);

_imageFlashTimer = setTimeout(() => {
  drawBoard(/* show images */);

  _roundTimer = setTimeout(() => {
    clearImages(_ctx, width, height, wedgeCount);
    _clickEnabled = true;
  }, displayDurationMs);
}, ROUND_IMAGE_FLASH_DELAY_MS);

Copilot AI linked an issue May 29, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Add pause before flashing images for Fast Piggie Fast Piggie: add 15ms pre-flash gap before image reveal May 29, 2026
Copilot AI requested a review from acrosman May 29, 2026 01:18
@acrosman acrosman marked this pull request as ready for review May 29, 2026 01:34
@acrosman acrosman merged commit 4a12f79 into main May 29, 2026
6 checks passed
@acrosman acrosman deleted the copilot/hit-fast-piggie-selection-wedges-sooner branch May 29, 2026 01:35
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.

Hit Fast Piggie selection wedges sooner

2 participants