Appearance
Lesson 10 — Close the feedback loop
Where this lesson fits: game rules now create meaningful outcomes. Make those outcomes legible through score, color, HUD, and sound without moving the rules into presentation.
Time: 3–4 hours
Prerequisites and outcomes
Complete lessons 06–09. By the end, you can trace a gameplay event to its model update and presentation cue, and explain the claimed-area renderer's cache boundary.
Prepare and run
- From your learner project's solution folder, follow tutorial chapter 08 steps 1–9.
- Open
Source\Systems\ScoringSystem.cs,Source\Rendering\HudRenderer.cs, andSource\Systems\AudioCuePlayer.cs. Run the focused command below. - Run
dotnet run --project Platforms\DesktopVKand perform the slow-draw, score, and fuse-warning steps in the tutorial's checkpoint. To observe level completion, keep capturing until the displayed percentage reaches the HUD target and note the status message. - Stage note: powerup effects and their HUD indicators arrive in tutorial chapter 11 / LP3 lesson 13. Revisit those indicators then.
Code anchors
last-perimeter/Source/Systems/ScoringSystem.cslast-perimeter/Source/Rendering/HudRenderer.csClaimedAreaRenderer.cs,BitmapTextRenderer.cs,PrimitiveDrawing.cslast-perimeter/Source/Systems/AudioCuePlayer.cslast-perimeter/Tests/Systems/ScoringSystemTests.cs
Guided operations
- Trace claim tile count and the trail's slow-draw flag into
ScoreClaim. Check the current per-percent overshoot and level-bonus rules. - Follow session values into the HUD. Identify indicators for claimed percentage, target, lives, score, fuse, and safety. Check temporary effects after lesson 13.
- Follow a claim into
ArenaSystemand then the cachedClaimedAreaRenderer. Explain why the renderer is marked dirty after committed grid changes. - Find how procedural drawing uses a one-pixel texture and how audio cues are synthesized. No content-pipeline import is required.
- Run scoring tests and play through warning, claim, and level completion. Compare screen feedback with model state. Test a powerup effect in lesson 13.
powershell
dotnet test --filter FullyQualifiedName~ScoringSystemTestsCheckpoint
Displayed state matches the model, slow claims are identified and scored from the trail's stored state, and render/audio code reports events rather than deciding gameplay outcomes.
Common mistakes
- Sampling the slow-draw input at claim completion instead of reading the completed trail.
- Rebuilding the render target during an open sprite batch.
- Letting a HUD string become the only record of a gameplay state.
Questions and extension
What feedback channel is available to a player who cannot rely on color or sound? Consider the shipped accessibility settings before proposing a new cue.

