Rhythm Fruit Shop gameplay — notes descending toward the judgment line in a fruit-shop themed rhythm game

Rhythm Fruit Shop — Native C++ Core


Context

A rhythm game is a real-time system with an unforgiving spec: judgment windows are tens of milliseconds wide, so every layer between the audio hardware and the player's input must be accounted for. I built this native C++20 core as a practice project, to work through timing, determinism and memory discipline without an engine doing the hard parts for me.

Decision

Song time derives from the audio backend's PCM cursor through an EMA-smoothed, re-anchoring clock, never from frame deltas. Input events carry host-monotonic timestamps mapped back into song time, so input-to-judgment is treated as a clock-domain crossing. The session core runs headless, which makes determinism testable: CI replays a recorded run, which must reproduce the recorded result exactly, and checks scoring against a reference scoring implementation. A custom operator-new AllocationGuard makes a headless test fail on any steady-state allocation in the gameplay path, and CMake dependency guards keep the core free of windowing and audio libraries.

Outcome

Record and replay, the allocation check and the layering rule all run as required headless CI gates, so a change that breaks them turns the build red.