Skip to content

Fast Piggie: fix outlier z-order and min display time tracking#67

Merged
acrosman merged 2 commits intomainfrom
copilot/fast-piggie-ux-improvements
Apr 15, 2026
Merged

Fast Piggie: fix outlier z-order and min display time tracking#67
acrosman merged 2 commits intomainfrom
copilot/fast-piggie-ux-improvements

Conversation

Copy link
Copy Markdown
Contributor

Copilot AI commented Apr 14, 2026

Two UX bugs in Fast Piggie: the target image could be obscured by distractors at high image counts, and the game card "Min Display Time" stat was showing answer response time (~87ms) instead of the actual minimum display duration (~10ms).

Outlier image z-order (index.jsdrawBoard)

Canvas 2D z-order is draw order. Previously all images were drawn wedge-by-wedge, so distractors rendered after the outlier would cover it. Fix defers the outlier's drawImage call until after the loop completes, ensuring it always renders on top.

// Save outlier draw params — rendered last to appear on top.
outlierDraw = { entry, imgCx, imgCy, drawH, drawW };
// ...after loop:
if (outlierDraw) ctx.drawImage(/* outlierDraw params */);

Min display time tracking (game.js + index.js)

lowestDisplayTime was being populated from topSpeedMs (time-to-click after images hide), not the actual round display duration. Introduces lowestRoundDisplayMs to track the minimum displayDurationMs across all rounds, passed from _currentRound into addScore/addMiss.

  • addScore(guineaPigs, answerSpeedMs, displayDurationMs) — new third param
  • addMiss(guineaPigs, displayDurationMs) — new second param
  • getBestStats() and stopGame() now expose lowestRoundDisplayMs
  • stop() uses bestStats.lowestRoundDisplayMslowestDisplayTime when saving score

Copilot AI linked an issue Apr 14, 2026 that may be closed by this pull request
Copilot AI changed the title [WIP] Improve user experience for Fast Piggie Fast Piggie: fix outlier z-order and min display time tracking Apr 14, 2026
Copilot AI requested a review from acrosman April 14, 2026 22:34
@acrosman acrosman marked this pull request as ready for review April 15, 2026 01:03
@acrosman acrosman merged commit 8769365 into main Apr 15, 2026
6 checks passed
@acrosman acrosman deleted the copilot/fast-piggie-ux-improvements branch April 15, 2026 01:10
This was referenced Apr 15, 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.

Fast Piggie UX Improvements

2 participants