Skip to content

Plot the player's level on the in-game trend chart - #241

Merged
acrosman merged 3 commits into
mainfrom
feat/191-level-trend-graph
Oct 25, 2026
Merged

acrosman merged 3 commits into
mainfrom
feat/191-level-trend-graph

Conversation

@acrosman

@acrosman acrosman commented Oct 25, 2026 •

Copy link
Copy Markdown
Owner

Summary

Flips the in-game trend chart so it shows the player's level after each trial instead of the falling speed metric. Stretches at a game's maximum level are drawn as a thicker green path.

Fixes #191

What changed and why

  • trendChartService.js: renderTrendChart(els, history, currentLevel) now takes { level, atMax } points. A new buildMaxLevelPath writes each run of 2+ consecutive at-max points into a <path> (maxLineEl) drawn over the polyline. The latest label reads N (max) at the maximum.
  • Every game: speedHistory/getSpeedHistory() is replaced by levelHistory/getLevelHistory(). When a point counts as max (as agreed on the issue):
    • Directional Processing, Fine Tuning, Sound Sweep: the last LEVELS entry.
    • Card Rat (level 17), High-Speed Memory (61), Orbit (11), Otter Stop (19): where display time hits its floor.
    • Fast Piggie: plots imageLevel, and counts as max once display time reaches 10 ms.
    • Object Track: never, because speed keeps rising.
    • Field of View: simulated level, 1 at the 500 ms start plus one per frame faster, never below 1, max 30 at 16.67 ms.
  • Card Rat now adds a point for every scored card. Before, it added one only when a hit sped the game up.
  • Markup/CSS: every interface.html has a "Level Trend" heading, the new max path, and "Latest level". The normal line is now muted ink (--trend-line: #4a5650, 7.5:1), and the new --trend-line-max is #2e8540 (4.5:1 on card). The max path is also twice as thick, so it isn't marked by color alone.
  • Tutorial slide text, tutorial screenshots, and the CLAUDE.md files are updated to match.

Testing

  • npm run lint is clean. npm run test:coverage passes 2223 tests with 100% function coverage.
  • New tests cover buildMaxLevelPath, the max path and "(max)" label, each game's at-max rule, and Field of View's getSimulatedLevel.
  • Ran the app with Playwright against an isolated user-data dir. Otter Stop's live chart drew the level line, and a synthetic history rendered through the real service showed the green max runs.

For reviewers

  • Each game's at-max rule is in its game.js push site; the numbers above are worth a sanity check.
  • All ten tutorial screenshots were retaken with Playwright to the screenshot standard, at the moment each game's tutorial notes name. Each crop matches the old one within a CSS pixel, so no callout percentages changed. I checked every screenshot slide in the app with its callouts.

Signed: Claude Code

🤖 Generated with Claude Code

acrosman and others added 3 commits October 25, 2026 10:56
The trend chart showed each game's speed metric, which falls as the
player improves. It now shows the 1-based level after each trial, so
the line rises with progress, and stretches at the maximum level are
drawn as a thicker green path over it.

Each game keeps a levelHistory of { level, atMax } points in place of
speedHistory. A level is the maximum at the last LEVELS entry, or from
the level where the game's display time reaches its floor. Object Track
has no maximum. Field of View has no levels, so it simulates one from
the SOA: level 1 at the 500 ms start, one more per frame faster, never
below 1, up to 30 at the fastest SOA. Fast Piggie plots its image level.
Card Rat now adds a point for every scored card, not only speed-ups.

The normal line is muted ink so the green max segments stand apart.

Fixes #191

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
The tutorial slides said the speed trend tracks display time and that
lower is better. They now call it the level trend and say when it turns
green.

Refs #191

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Every game's tutorial screenshot showed the old "Speed Trend (ms)"
chart. Each is retaken to the screenshot standard (1280x880 window,
device scale, clipped to the game area) at the moment its tutorial
notes name. Each crop matches the old one within a CSS pixel, so the
callout boxes still line up and their percentages are unchanged.

Refs #191

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@acrosman
acrosman merged commit e6ccb5f into main Oct 25, 2026
7 checks passed
@acrosman
acrosman deleted the feat/191-level-trend-graph branch October 25, 2026 23:03
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.

Flip the progress graph

1 participant