Skip to content

Requirements of the finished game ​

This page lists everything Last Perimeter must do. Each chapter builds a group of these requirements. The proof for each one is a named test or a short manual check. Chapter 21 uses this page as its sign-off table.

Back to the course front page

What a requirement is ​

A requirement is one sentence that says what the game must do, paired with a check that shows it is true. Writing the check next to the sentence stops a rule from staying vague. If you cannot say how to prove a rule, you do not yet know what the rule is.

Each requirement has an ID. The letters name the area and the number orders the rows within it. The same ID appears in the chapter introductions, in each "requirements this chapter builds" list and in the sign-off table.

The numbers used below come from the game's configuration. The screen is 1024 x 768. The arena is the rectangle at (50, 122) with size 924 x 552. The tile size is 4 px, so the grid is 231 x 138 tiles, which is 31,878 in total.

How to read a row ​

ColumnMeaning
IDA stable reference. The prefix is the area, for example TRL for the trail.
RequirementWhat must be true, in one sentence.
Acceptance checkThe observable condition that proves it, with the real numbers.
ProofThe test that proves it, or the word "Checkpoint", "Code review" or "CI".
ChThe chapter that builds it. Two chapters mean the rule is built in one and extended in the other.

A name in backticks in the Proof column is a test. You write that test in the chapter named in the last column. "Checkpoint" is a manual check that the chapter walks you through.

How to prove a requirement ​

Run the test by name. From the LastPerimeter folder, run dotnet test --filter with part of the test name. The filter FullyQualifiedName~Name keeps every test whose full name contains Name.

dotnet test --filter "FullyQualifiedName~ApplyClaimResult_CountsEachTileOnce_AndUpdatesPercentage"

The summary line should report Passed: 1 and Failed: 0. A filter that matches nothing is not an error. The run reports that no test matches the given filter, so check the spelling if you see that message.

To run several named tests at once, join the terms with |, which means "or".

dotnet test --filter "FullyQualifiedName~TryWorldToGrid_MapsPositionsInsideBounds_AndRejectsOutside|FullyQualifiedName~GetTileState_ReturnsBoundary_ForInvalidGridPoints"

A [Theory] is one test method that runs once for each [InlineData] row. The summary counts one pass for each row, so a filter that names one theory can report Passed: 6. The C# primer explains how.

Run every proof test at once ​

The commands below list every named proof test on this page, so together they run all of them. Run each command from the LastPerimeter folder. The list is split because a single command line has a length limit on some systems. Run a command only after you have written the tests it names, because tests from later chapters do not exist in your project yet.

Command 1 of 4

dotnet test --filter "FullyQualifiedName~Parse_UsesSmokeTestArgument_WhenProvided|FullyQualifiedName~Parse_FallsBackToEnvironmentValue_WhenNoArgumentProvided|FullyQualifiedName~Parse_ThrowsForMissingArgumentValue|FullyQualifiedName~ArenaBounds_LeavesMarginAndHudReserves|FullyQualifiedName~Constructor_SizesGridFromBoundsAndTileSize|FullyQualifiedName~NewArena_HasEveryTileUnclaimed|FullyQualifiedName~TryWorldToGrid_MapsPositionsInsideBounds_AndRejectsOutside|FullyQualifiedName~GetTileState_ReturnsBoundary_ForInvalidGridPoints|FullyQualifiedName~ApplyClaimResult_CountsEachTileOnce_AndUpdatesPercentage|FullyQualifiedName~ApplyClaimResult_RecordsSlowDrawPerTile|FullyQualifiedName~ApplyInsetClaim_ClaimsOnlyTheBorderRing|FullyQualifiedName~InitialArenaPath_IsClosedRectangle|FullyQualifiedName~RebuildPlayablePath_MergesCollinearFaces|FullyQualifiedName~RebuildPlayablePath_AfterClaim_MatchesRemainingPlayableRegion|FullyQualifiedName~Contains_UsesTwoPixelTolerance|FullyQualifiedName~CompleteTrail_OnPathReconnect_SnapsWithoutGap|FullyQualifiedName~Rectangle_HasFourNodesWithTwoSegmentsEach|FullyQualifiedName~PressedEdge_IsTrueForOneFrameOnly|FullyQualifiedName~Thumbstick_InsideDeadZone_DoesNotMove|FullyQualifiedName~PausePress_OpensPauseAndIsConsumed|FullyQualifiedName~CalculateNextPosition_ScalesWithDeltaTime|FullyQualifiedName~DetermineDirection_WithNoInput_ReturnsNone|FullyQualifiedName~DetermineDirection_PrefersHorizontal|FullyQualifiedName~PlayerCannotTraverseClaimedInterior_WhenNotDrawing|FullyQualifiedName~PlayerCanTraverseConnectedCornerSegment_WhenDirectionChangesAtNode|FullyQualifiedName~StartLevel_PlacesPlayerOnTopLeftNode|FullyQualifiedName~Tick_AppliesRunAndSlowDrawSpeedFactors|FullyQualifiedName~StartTrail_FromWallPath_AnchorsToPath|FullyQualifiedName~Tick_DoesNotStartTrailDuringGrace|FullyQualifiedName~AddPoint_IgnoresPointsCloserThanHalfPixel|FullyQualifiedName~CanAdvance_BlocksReversal_OntoActiveTrail|FullyQualifiedName~CanAdvance_RefusesClaimedTile|FullyQualifiedName~CanCompleteOnPath_RequiresMinimumLength|FullyQualifiedName~SelfIntersection_IsDetected_AtLoopClosure|FullyQualifiedName~TryStart_DefaultsToFastDraw"

Command 2 of 4

dotnet test --filter "FullyQualifiedName~TryStart_LatchesSlowDrawOntoTrail|FullyQualifiedName~UpdateSlowDraw_ReleasingTheInputDemotesTheTrailPermanently|FullyQualifiedName~Cancel_MarksTrailCancelled|FullyQualifiedName~GetPointAtDistance_InterpolatesAlongSegment|FullyQualifiedName~GetPointAtDistance_ClampsToTrailEndpoints|FullyQualifiedName~GetPointAtDistance_ReturnsZero_WhenTrailIsEmpty|FullyQualifiedName~Fuse_WarnsBeforeIgnition_AndIsExtinguishedWhenTheTrailEnds|FullyQualifiedName~FuseTriggersAfterDelay_AndReachesPlayer|FullyQualifiedName~FusePausesWhenPlayerMoves_AndResumesOnStop|FullyQualifiedName~Tick_HoldingBlockedDirection_LetsFuseBurn|FullyQualifiedName~Tick_RaisesFuseWarningOnce|FullyQualifiedName~ProcessCompletedTrail_DoesNotChangeTheLiveGrid|FullyQualifiedName~ProcessCompletedTrail_ClaimsSmallerRegion_WhenNoEnemies|FullyQualifiedName~ProcessCompletedTrail_ReturnsNull_WhenTrailDoesNotPartitionArena|FullyQualifiedName~ProcessCompletedTrail_AvoidsEnemyRegion|FullyQualifiedName~ProcessCompletedTrail_CapturesSmallestRegionAndEliminatesContainedEnemy_WhenEachSideContainsAnEnemy|FullyQualifiedName~Capture_AppendsOrderedCaptureHistory|FullyQualifiedName~RejectedLoop_ReturnsPlayerToAnchor|FullyQualifiedName~RebuiltPath_AllowsTraversalAlongRemainingBoundaryAfterClaim|FullyQualifiedName~CreateRoster_SpreadsEnemiesAcrossTheArena|FullyQualifiedName~Update_EnemyBesideFreshCapture_RecoversAndKeepsMoving|FullyQualifiedName~Update_BlockedOnX_ReflectsHorizontalVelocity|FullyQualifiedName~Update_WithSameSeed_RetargetsIdentically|FullyQualifiedName~Retarget_WithPressureTarget_TurnsTowardPlayer|FullyQualifiedName~Update_AppliesVariantSpeedMultiplier_ToActualMovement|FullyQualifiedName~TrySpawnSplitterClone_WaitsForTheSplitTimer_ThenRearmsIt|FullyQualifiedName~SpawnedClone_IsASmallerSlowerTemporaryHunter|FullyQualifiedName~Update_TemporaryClone_ExpiresWhenLifetimeRunsOut|FullyQualifiedName~ClonesOtherVariantsAndFrozenSplitters_NeverSplit|FullyQualifiedName~Update_SplitterCloneOnClaimedGround_RecoversToFreeGround|FullyQualifiedName~Update_WhenFrozen_DoesNotMove|FullyQualifiedName~EnclosingCapture_RemovesEliminatedEnemies|FullyQualifiedName~PlayerCollision_OnlyCountsWhileDrawing"

Command 3 of 4

dotnet test --filter "FullyQualifiedName~TrailCollision_IsDetected|FullyQualifiedName~Tick_IgnoresHitsDuringGrace|FullyQualifiedName~GetStartingLives_DependsOnDifficulty|FullyQualifiedName~TryBlockWithShield_SpendsOneChargeInsteadOfALife|FullyQualifiedName~ShieldBlock_ReturnsPlayerToWallWithGrace|FullyQualifiedName~LoseLife_CancelsTrailAndFuse|FullyQualifiedName~LoseLife_OnLastLife_EndsTheRun|FullyQualifiedName~SelectRespawnNode_PrefersNodesFarFromEnemies|FullyQualifiedName~Respawn_StartsGraceFromConfig|FullyQualifiedName~ScoreClaim_UsesTileCount|FullyQualifiedName~ScoreClaim_AppliesSlowDrawAndRunMultipliers|FullyQualifiedName~Capture_DuringDoublePoints_ScoresDouble|FullyQualifiedName~CalculateLevelBonus_GrowsWithLevel|FullyQualifiedName~CalculateThresholdBonus_AwardsPointsPerPercentAboveTarget|FullyQualifiedName~RecordRunFinished_KeepsTheHigherScore|FullyQualifiedName~CaptureReachingTarget_ClearsTheLevel|FullyQualifiedName~CreateLevel_ScalesEnemyRosterAndGoal|FullyQualifiedName~CreateLevel_AddsInsetFromLevelSix|FullyQualifiedName~CreateLevel_AppliesDifficultyPresetAdjustments|FullyQualifiedName~StartLevel_ResetsTheArenaButKeepsTheRun|FullyQualifiedName~Tick_NeverSpawnsAThirdPowerup|FullyQualifiedName~ResetForLevel_RestoresTheFirstSpawnDelay|FullyQualifiedName~Spawn_RearmsTimerBetweenSevenAndElevenSeconds|FullyQualifiedName~Spawn_UsesWallNodesForPlacement|FullyQualifiedName~Spawn_WithSameSeed_PicksSameTypeAndNode|FullyQualifiedName~UpdatePowerups_RemovesExpiredPowerups|FullyQualifiedName~TryCollect_RemovesPowerupWhenPlayerIsInRange|FullyQualifiedName~Apply_EachTypeChangesOnlyItsOwnState|FullyQualifiedName~StartRun_FromLevelSelect_StartsAtChosenLevel|FullyQualifiedName~CreateUpgradeChoices_ReturnsThreeDistinctOptions|FullyQualifiedName~CreateChoices_WithSameSeed_IsRepeatable|FullyQualifiedName~Apply_FasterMovement_IncreasesMoveSpeedMultiplier|FullyQualifiedName~Apply_SlowerFuse_AddsFuseDelayBonus|FullyQualifiedName~Apply_HigherScoring_IncreasesScoreMultiplier|FullyQualifiedName~Apply_SaferRespawn_AddsRespawnGraceBonus|FullyQualifiedName~Apply_StacksAcrossRepeatedPicks|FullyQualifiedName~ApplyUpgrade_BonusLife_AddsALifeAndRecordsTheChoice"

Command 4 of 4

dotnet test --filter "FullyQualifiedName~Apply_BonusLife_LeavesModifierAggregateUnchanged|FullyQualifiedName~ApplyUpgrade_HigherScoring_UpdatesRunModifiers|FullyQualifiedName~DailySeed_IsTheUtcDayNumber|FullyQualifiedName~DailyChallengeActive_FollowsRunMode|FullyQualifiedName~SameSeedAndInput_GiveTheSameRun|FullyQualifiedName~MainMenu_ConfirmOnEachItem_IssuesItsCommand|FullyQualifiedName~MenuList_WrapsAtBothEnds|FullyQualifiedName~SceneManager_PushedOverlay_DrawsTheSceneBelow|FullyQualifiedName~SceneManager_Pop_ReturnsToCaller|FullyQualifiedName~LevelSelect_StopsAtHighestUnlockedLevel|FullyQualifiedName~Tutorial_FinishingLastPage_MarksItCompleted|FullyQualifiedName~Load_ReturnsDefaultProfile_WhenFileDoesNotExist|FullyQualifiedName~Load_ReturnsDefaultProfile_WhenFileIsCorrupt|FullyQualifiedName~Save_LeavesNoTemporaryFile|FullyQualifiedName~SaveThenLoad_RoundTripsProfileValues|FullyQualifiedName~Save_ReturnsFalse_WhenProfileFolderCannotBeCreated|FullyQualifiedName~SaveIfDirty_WritesOnceThenReportsClean|FullyQualifiedName~SaveHook_NeverRunsDuringGameplay|FullyQualifiedName~RecordLevelCleared_UnlocksNextLevel|FullyQualifiedName~RecordRunFinished_UpdatesDailyBestOnlyForDailyRuns|FullyQualifiedName~RecordedEvents_RaiseTheirCounters|FullyQualifiedName~StatusText_MapsEveryEventToALine|FullyQualifiedName~Constructor_WithNoAudioDevice_RunsSilentAndPlayDoesNothing|FullyQualifiedName~Configure_ClampsMasterVolume|FullyQualifiedName~Create_EveryPresetFillsEveryRole|FullyQualifiedName~ColorblindMode_ReplacesOnlyTheSevenRoles|FullyQualifiedName~UiScale_IsClampedToRange"

Checkpoints that need a window or speakers ​

A test cannot see pixels or hear a sound, so some rows are proved by a checkpoint. A checkpoint is a short manual check in the chapter. Most of them need you to run the game and look at the window. The audio rows need working speakers or headphones.

  • Needs the game window: PLT-05, INP-01, FE-01, FE-08, FE-09, HUD-01, HUD-02, HUD-04, REN-01, REN-02, REN-03, REN-04, THM-03 and THM-05.
  • Needs speakers or headphones: AUD-01, and the checkpoint half of AUD-03.
  • Needs a build or a published folder: PLT-01, PLT-02, PLT-03 and PLT-07.
  • Needs a look at a file: PRO-01, which checks that the profile file exists in your local application data folder.
  • Needs a timer or a profiler: CAP-10 and NFR-01.
  • Run by continuous integration: PLT-06 and NFR-04 are proved by the workflow you set up in chapter 21.
  • Proved by reading the code: INP-03, CAP-09, NFR-03 and NFR-05.

PLT-04 and PLT-07 also use the smoke run. Set LASTPERIMETER_SMOKE_TEST_SECONDS=2 or pass --smoke-test-seconds 2, and the game exits with code 0 after two seconds.

PLT - Platform, build and tooling ​

IDRequirementAcceptance checkProofCh
PLT-01The game uses the MonoGame 3.8.6.1 Empty Game template layout on .NET 10.dotnet build LastPerimeter.sln gives 0 warnings and 0 errors. The MonoGame version is set once, in Directory.Packages.props.Checkpoint01
PLT-02One shared Source/ folder is compiled by every platform project and by the tests.Platforms/DesktopVK and Platforms/WindowsDX12 contain only a 5-line Program.cs, a manifest and a project file.Checkpoint01
PLT-03The game needs no content files.Content/Assets/ is empty. Every visual comes from a 1x1 white texture. Every sound is synthesised.Checkpoint01, 12
PLT-04The game can run itself for a set time and exit, for CI.--smoke-test-seconds 2 or LASTPERIMETER_SMOKE_TEST_SECONDS=2 exits with code 0 after 2 s. A missing or invalid value throws ArgumentException.Parse_UsesSmokeTestArgument_WhenProvided, Parse_FallsBackToEnvironmentValue_WhenNoArgumentProvided, Parse_ThrowsForMissingArgumentValue01
PLT-05The window is 1024 x 768 with the mouse visible.The back buffer is 1024 x 768.Checkpoint01
PLT-06CI builds and tests the game and every chapter snapshot, and fails on snapshot drift, listing drift or a broken link.The workflow fails when any of these differ.CI run21
PLT-07The game publishes as a self-contained build that runs on a machine with no .NET installed.dotnet publish Platforms/DesktopVK -c Release -r win-x64 --self-contained produces a build that starts and exits 0 with the smoke option.Checkpoint21

ARN - Arena and tile grid ​

IDRequirementAcceptance checkProofCh
ARN-01The arena sits inside the screen with a 50 px margin, 72 px reserved above for the HUD and 44 px below.GameConfig.ArenaBounds is (50, 122, 924, 552).ArenaBounds_LeavesMarginAndHudReserves03
ARN-02The arena is a grid of 4 px tiles.The grid is 231 x 138 tiles, 31,878 in total.Constructor_SizesGridFromBoundsAndTileSize03
ARN-03Every tile is in exactly one state: Unclaimed, ClaimedByPlayer or Boundary.A new arena has every tile Unclaimed.NewArena_HasEveryTileUnclaimed03
ARN-04A world position inside the arena maps to exactly one tile. A position outside maps to none.TryWorldToGrid returns true and a clamped tile inside, false outside.TryWorldToGrid_MapsPositionsInsideBounds_AndRejectsOutside03
ARN-05A tile outside the grid reads as Boundary, never as an error.GetTileState(new Point(-1, 0)) is Boundary.GetTileState_ReturnsBoundary_ForInvalidGridPoints03
ARN-06Claiming a tile counts it once, and the claimed percentage is the claimed tiles over all tiles.Claiming the same tile twice adds 1 to ClaimedTileCount.ApplyClaimResult_CountsEachTileOnce_AndUpdatesPercentage03
ARN-07Each claimed tile records whether it was claimed by a slow-draw trail.IsSlowClaimed is true only for tiles claimed with slowDraw: true.ApplyClaimResult_RecordsSlowDrawPerTile03
ARN-08A level can start with an inset border of claimed tiles.With an inset of 2, the outer 2 rings of tiles are claimed and every other tile is not.ApplyInsetClaim_ClaimsOnlyTheBorderRing14

WAL - The playable wall path ​

IDRequirementAcceptance checkProofCh
WAL-01The wall path is derived from the grid: every face of an unclaimed tile that borders a non-unclaimed tile or the grid edge is wall.A new arena gives a closed rectangle on the arena bounds.InitialArenaPath_IsClosedRectangle06
WAL-02Adjacent collinear faces are merged into one segment.A new arena has exactly 4 segments, not 2 x (231 + 138).RebuildPlayablePath_MergesCollinearFaces06
WAL-03The wall path is rebuilt in full after every claim, never patched.After a claim, the path matches the outline of the remaining unclaimed region.RebuildPlayablePath_AfterClaim_MatchesRemainingPlayableRegion06, 09
WAL-04A point is on the path when it is within 2 px of a segment.Contains is true at 2 px and false at 3 px.Contains_UsesTwoPixelTolerance06
WAL-05Any point can be snapped to the nearest point on the path.Snap returns a point on the nearest segment.CompleteTrail_OnPathReconnect_SnapsWithoutGap06
WAL-06The path exposes its distinct nodes and how many segments meet at each.A rectangle has 4 nodes, each with 2 connected segments.Rectangle_HasFourNodesWithTwoSegmentsEach06

INP - Input ​

IDRequirementAcceptance checkProofCh
INP-01Keyboard and gamepad both drive the game.Arrows, D-pad and left stick move. Space, Left Shift, right trigger and A slow-draw. Enter, Space and A confirm. Escape, Backspace and B cancel. Escape and Start pause.Checkpoint04
INP-02Movement and slow draw are held states. Menu and confirm actions are single presses.A key held for 10 frames gives 10 frames of IsMovingUp and 1 frame of IsMenuUpPressed.PressedEdge_IsTrueForOneFrameOnly (through a fake device reader)04
INP-03Input is read once per frame into an immutable value.InputState is a readonly record struct.Code review04
INP-04The left stick has a 0.2 dead zone and the right trigger a 0.35 threshold.A stick at 0.15 does not move. A stick at 0.25 does.Thumbstick_InsideDeadZone_DoesNotMove (through a fake device reader)04
INP-05The press that opens the pause menu is not seen by the pause menu.Pressing Escape once pauses and does not immediately resume.PausePress_OpensPauseAndIsConsumed17

MOV - Player movement ​

IDRequirementAcceptance checkProofCh
MOV-01Movement is continuous and time-based at 150 px per second.One 0.1 s step moves 15 px.CalculateNextPosition_ScalesWithDeltaTime04
MOV-02Movement is cardinal only. When several directions are held, Left wins, then Right, Up, Down.Left and Up held together gives Left. Nothing held gives None.DetermineDirection_WithNoInput_ReturnsNone, DetermineDirection_PrefersHorizontal04
MOV-03When not drawing, the player moves only along the wall path.A move into claimed or unclaimed interior is refused and the position does not change.PlayerCannotTraverseClaimedInterior_WhenNotDrawing06
MOV-04The player turns corners where segments meet.At a node, a perpendicular move succeeds.PlayerCanTraverseConnectedCornerSegment_WhenDirectionChangesAtNode06
MOV-05Each level starts the player on the left-most, then top-most, node.On a new arena the player starts at (50, 122).StartLevel_PlacesPlayerOnTopLeftNode06
MOV-06Speed is the base speed x the run speed multiplier, halved while slow drawing.Base 150, one Quickstep upgrade (+15%) and slow draw gives 86.25 px/s.Tick_AppliesRunAndSlowDrawSpeedFactors07, 18

TRL - The trail ​

IDRequirementAcceptance checkProofCh
TRL-01A trail starts when the player, on the wall, moves into an unclaimed tile, and only after the respawn grace has ended.Pushing inward from the wall starts a trail. During grace it does not.StartTrail_FromWallPath_AnchorsToPath, Tick_DoesNotStartTrailDuringGrace07, 11
TRL-02The trail's first point is the snapped wall anchor, so the drawn line has no gap at the wall.Points[0] is on the wall path.StartTrail_FromWallPath_AnchorsToPath07
TRL-03Points closer than 0.5 px to the last point are ignored, and the trail tracks its total length.Adding a point 0.3 px away leaves the count and length unchanged.AddPoint_IgnoresPointsCloserThanHalfPixel07
TRL-04The player cannot reverse along their own trail.A move opposite to the last accepted direction is refused. A refused move does not change the recorded direction.CanAdvance_BlocksReversal_OntoActiveTrail07
TRL-05A trail cannot enter a claimed tile.CanAdvance is false for a claimed target.CanAdvance_RefusesClaimedTile07
TRL-06Reaching the wall completes the trail, if it is at least 20 px long.A 19 px trail touching the wall stays active. A 20 px trail completes.CanCompleteOnPath_RequiresMinimumLength07
TRL-07Crossing its own trail closes a loop at the crossing point. The check needs at least 4 points.A square drawn back across its first segment reports the intersection.SelfIntersection_IsDetected_AtLoopClosure07
TRL-08Slow draw is decided when the trail starts and is lost for good the moment the input is released.Start with slow held, release once, hold again: the trail stays fast.TryStart_DefaultsToFastDraw, TryStart_LatchesSlowDrawOntoTrail, UpdateSlowDraw_ReleasingTheInputDemotesTheTrailPermanently07
TRL-09Death or a shield block cancels the active trail.After either, ActiveTrail is null and the old trail is Cancelled.Cancel_MarksTrailCancelled07, 11
TRL-10The fuse can find the point at any distance along the trail.GetPointAtDistance interpolates inside a segment and clamps at both ends. An empty trail gives the zero vector.GetPointAtDistance_InterpolatesAlongSegment, GetPointAtDistance_ClampsToTrailEndpoints, GetPointAtDistance_ReturnsZero_WhenTrailIsEmpty08

FUS - The fuse ​

IDRequirementAcceptance checkProofCh
FUS-01After 1.0 s stopped mid-trail, the fuse warns.IsWarning becomes true at 1.0 s.Fuse_WarnsBeforeIgnition_AndIsExtinguishedWhenTheTrailEnds08
FUS-02After 2.0 s stopped, the fuse ignites at the trail's start. Each Cool Fuse upgrade adds 0.5 s.IsActive becomes true at 2.0 s, with Position at Points[0].FuseTriggersAfterDelay_AndReachesPlayer08, 18
FUS-03A lit fuse burns along the trail at 60 px per second.After 1 s of burning, Position is 60 px along the trail.FuseTriggersAfterDelay_AndReachesPlayer08
FUS-04Moving pauses the fuse. Stopping again resumes it from where it was.The burn distance holds while the player moves.FusePausesWhenPlayerMoves_AndResumesOnStop08
FUS-05The fuse kills when it reaches the player, within 1 px of the trail's end.Update returns true once the burn distance passes TotalLength - 1.FuseTriggersAfterDelay_AndReachesPlayer08
FUS-06Completing or cancelling the trail, or a Fuse Reset powerup, puts the fuse out.After any of these, IsActive and IsWarning are false.Fuse_WarnsBeforeIgnition_AndIsExtinguishedWhenTheTrailEnds08, 15
FUS-07"Moving" means the player's position changed, not that a key is held.Holding a blocked direction still lets the fuse burn.Tick_HoldingBlockedDirection_LetsFuseBurn08
FUS-08The warning is reported once per stop, not every frame.One FuseWarning event per warning.Tick_RaisesFuseWarningOnce12

CAP - Capture ​

IDRequirementAcceptance checkProofCh
CAP-01A completed trail is rasterised onto the grid with Bresenham line stepping and treated as wall while solving.The solver works on a copy of the grid. The live grid does not change until the result is applied.ProcessCompletedTrail_DoesNotChangeTheLiveGrid09
CAP-02The unclaimed space is split into regions with a 4-neighbour breadth-first flood fill.A straight wall-to-wall trail gives exactly 2 regions.ProcessCompletedTrail_ClaimsSmallerRegion_WhenNoEnemies09
CAP-03A trail that does not split the space claims nothing.Fewer than 2 regions returns null.ProcessCompletedTrail_ReturnsNull_WhenTrailDoesNotPartitionArena09
CAP-04The claimed region is the smallest region with no enemy in it.With an enemy in the smaller side, the larger enemy-free side is claimed.ProcessCompletedTrail_AvoidsEnemyRegion09
CAP-05If every region holds an enemy, the smallest region is claimed and its enemies are eliminated.The result lists the eliminated enemy indexes.ProcessCompletedTrail_CapturesSmallestRegionAndEliminatesContainedEnemy_WhenEachSideContainsAnEnemy09
CAP-06Applying a claim marks the region's tiles and the trail's tiles as claimed.Claimed count rises by region tiles plus new trail tiles.ApplyClaimResult_CountsEachTileOnce_AndUpdatesPercentage09
CAP-07Every capture is recorded in order with its tiles and its slow-draw flag.CaptureHistory gains one CapturedZone with Order 1, 2, 3 and so on.Capture_AppendsOrderedCaptureHistory09
CAP-08A rejected loop returns the player to the trail's wall anchor. A rejected wall reconnect leaves them on the wall.After a CaptureRejected from a loop, the player is at Points[0].RejectedLoop_ReturnsPlayerToAnchor09
CAP-09Selection rules are an ordered list, so a new rule is one method and one list entry.The rules run in order until one returns a selection.Code review09
CAP-10Solving a capture on the full arena fits inside a frame.About 3.6 ms in Release on the full 31,878-tile grid, as measured in the final review.Checkpoint (timed in chapter 13)09, 13
CAP-11After a capture the player is snapped onto the rebuilt wall.The player position is on the new path.RebuiltPath_AllowsTraversalAlongRemainingBoundaryAfterClaim09

ENM - Enemies ​

IDRequirementAcceptance checkProofCh
ENM-01A level's enemies are created from its roster, spread evenly across the arena width, alternating 40 px above and below the centre line.3 enemies sit at 1/4, 2/4 and 3/4 of the width.CreateRoster_SpreadsEnemiesAcrossTheArena14
ENM-02An enemy only occupies unclaimed space. It probes its centre and 4 points at its 7 px radius.A move that would put any probe on a claimed tile is refused.Update_EnemyBesideFreshCapture_RecoversAndKeepsMoving10
ENM-03A blocked enemy bounces by reversing the blocked axis.Hitting a vertical wall flips Velocity.X only.Update_BlockedOnX_ReflectsHorizontalVelocity10
ENM-04An enemy picks a new heading every 0.65 s, jittered by 0.75 to 1.25 times.DirectionChangeTimer is reset inside that range.Update_WithSameSeed_RetargetsIdentically10
ENM-05While the player draws, enemies steer toward the player. Hunters weight the player 0.7, Splitters 0.5, Wanderers 0.4, with a random turn of up to 35 degrees.With a pressure target, the new heading lies between the old heading and the target.Retarget_WithPressureTarget_TurnsTowardPlayer10
ENM-06Variants move at different speeds: Hunter x1.12, Splitter x1.05, Wanderer x1.0.One second of Hunter movement covers 1.12 times the Wanderer's distance.Update_AppliesVariantSpeedMultiplier_ToActualMovement10
ENM-07A Splitter spawns a temporary Hunter clone after 6 s and then every 8 s. The clone is 0.75 the size and 0.9 the speed, and lives 5 s.The first clone appears at 6 s, the second at 14 s.TrySpawnSplitterClone_WaitsForTheSplitTimer_ThenRearmsIt, SpawnedClone_IsASmallerSlowerTemporaryHunter14
ENM-08Clones expire and never split. Other variants never split.After 5 s the clone's Update returns false.Update_TemporaryClone_ExpiresWhenLifetimeRunsOut, ClonesOtherVariantsAndFrozenSplitters_NeverSplit14
ENM-09An enemy left on claimed ground, by a capture or a clone spawn, moves to the nearest free point within 24 px before moving on.The enemy keeps moving after a capture beside it.Update_EnemyBesideFreshCapture_RecoversAndKeepsMoving, Update_SplitterCloneOnClaimedGround_RecoversToFreeGround10, 14
ENM-10A frozen enemy does not move or split, but keeps spinning.Position unchanged after a frozen update.Update_WhenFrozen_DoesNotMove10
ENM-11Every random choice an enemy makes comes from an injected Random.Two systems with the same seed produce the same headings.Update_WithSameSeed_RetargetsIdentically10
ENM-12Enemies eliminated by a capture are removed from the session.After an enclosing capture, the enemy count drops by the eliminated count.EnclosingCapture_RemovesEliminatedEnemies10

COL - Collision ​

IDRequirementAcceptance checkProofCh
COL-01The player is hit only while drawing, when the player and enemy circles overlap (radius 6 and 7).Overlap on the wall is ignored. Overlap while drawing is a hit.PlayerCollision_OnlyCountsWhileDrawing10
COL-02The trail is hit when an enemy comes within its radius + 1 px of any trail segment while the trail is in progress.An enemy crossing the trail is a hit.TrailCollision_IsDetected10
COL-03Hits are ignored while the player is invulnerable after a respawn or shield block.No PlayerHit event during grace.Tick_IgnoresHitsDuringGrace11

LIV - Lives, shields and respawn ​

IDRequirementAcceptance checkProofCh
LIV-01A run starts with 4 lives on Chill, 3 on Classic and 2 on Hardcore.GetStartingLives returns those values.GetStartingLives_DependsOnDifficulty14
LIV-02A hit or a fuse kill uses a shield charge first, if the player has one.With one charge, a hit leaves lives unchanged and charges at 0.TryBlockWithShield_SpendsOneChargeInsteadOfALife11
LIV-03A shield block cancels the trail, puts out the fuse, snaps the player to the wall and starts the respawn grace.After a block the player is on the wall with grace running.ShieldBlock_ReturnsPlayerToWallWithGrace11
LIV-04A death costs one life, cancels the trail and puts out the fuse.Lives drop by 1. ActiveTrail is null.LoseLife_CancelsTrailAndFuse11
LIV-05Losing the last life ends the run.The simulation state becomes RunLost and a RunLost event is raised.LoseLife_OnLastLife_EndsTheRun11
LIV-06The player respawns on the wall node with the highest score, where the score is the squared distance to the nearest enemy plus 500 for each segment meeting at the node.With one enemy in the top-left corner, the player respawns at a far corner.SelectRespawnNode_PrefersNodesFarFromEnemies11
LIV-07After a respawn or shield block the player is invulnerable for 1.2 s. Each Safe Return upgrade adds 0.5 s.RespawnGraceRemaining is 1.2 at the start of grace.Respawn_StartsGraceFromConfig11, 18

SCO - Score ​

IDRequirementAcceptance checkProofCh
SCO-01A capture scores 10 points per tile, counting the region and the trail tiles.100 tiles score 1,000.ScoreClaim_UsesTileCount12
SCO-02A slow-draw capture scores double.100 slow tiles score 2,000.ScoreClaim_AppliesSlowDrawAndRunMultipliers12
SCO-03The run score multiplier applies to every capture: 1.0, plus 0.25 per Double Down upgrade.100 tiles with one Double Down score 1,250.ScoreClaim_AppliesSlowDrawAndRunMultipliers12, 18
SCO-04During Double Points every capture scores double.100 tiles during Double Points score 2,000.Capture_DuringDoublePoints_ScoresDouble15
SCO-05Clearing a level adds 1,000 + 500 x the level number.Level 3 adds 2,500.CalculateLevelBonus_GrowsWithLevel14
SCO-06Clearing a level adds 1,000 for every whole percent claimed above the target.78.6% on a 75% target adds 3,000.CalculateThresholdBonus_AwardsPointsPerPercentAboveTarget14
SCO-07The high score is shown during play and kept when a run ends with a higher score.A run of 5,000 after a best of 4,000 sets the best to 5,000.RecordRunFinished_KeepsTheHigherScore16

LVL - Levels and difficulty ​

IDRequirementAcceptance checkProofCh
LVL-01A level is cleared when the claimed percentage reaches its target.The capture that crosses the target raises LevelCleared with the bonus.CaptureReachingTarget_ClearsTheLevel14
LVL-02Enemy count is 1 + (level - 1) / 3, capped at 4.Levels 1, 4, 7 and 10 have 1, 2, 3 and 4 enemies.CreateLevel_ScalesEnemyRosterAndGoal14
LVL-03Enemy speed multiplier is 1 + 0.1 x (level - 1).Level 5 is 1.4.CreateLevel_ScalesEnemyRosterAndGoal14
LVL-04The claim target is 75 + (level - 1), capped at 90.Level 1 is 75%, level 20 is 90%.CreateLevel_ScalesEnemyRosterAndGoal14
LVL-05From level 6 the arena starts with an inset border of min((level - 4) / 2, 3) tiles.Levels 5, 6, 8 and 10 have insets 0, 1, 2 and 3.CreateLevel_AddsInsetFromLevelSix14
LVL-06The roster gains a Hunter in slot 2 from level 4, a Splitter in slot 3 from level 7 and a Hunter in slot 4 from level 10. Other slots are Wanderers.Level 10 is Wanderer, Hunter, Splitter, Hunter.CreateLevel_ScalesEnemyRosterAndGoal14
LVL-07Chill lowers the target by 5 (not below 70) and slows enemies to x0.9. Hardcore raises it by 5 (not above 90) and speeds them to x1.15.Level 1 Chill is 70%, Hardcore is 80%.CreateLevel_AppliesDifficultyPresetAdjustments14
LVL-08A new level resets the arena, wall, trail, fuse, powerups, enemies and timed effects, and keeps score, lives, shields and upgrades.After level 1 is cleared, level 2 starts with 0% claimed and the same score.StartLevel_ResetsTheArenaButKeepsTheRun14

PWR - Powerups ​

IDRequirementAcceptance checkProofCh
PWR-01At most 2 powerups are on the wall at once.A third never spawns while 2 are live.Tick_NeverSpawnsAThirdPowerup15
PWR-02The first powerup of each level waits 6 s.No spawn before 6 s of a new level.ResetForLevel_RestoresTheFirstSpawnDelay15
PWR-03Later powerups wait 7 s plus up to 4 s.The timer after a spawn is between 7 and 11 s.Spawn_RearmsTimerBetweenSevenAndElevenSeconds15
PWR-04A powerup spawns on a random wall node with a random type from the 5.The position is one of PlayableWallPath.Nodes.Spawn_UsesWallNodesForPlacement, Spawn_WithSameSeed_PicksSameTypeAndNode15
PWR-05An uncollected powerup disappears after 8 s.After 8 s it is removed.UpdatePowerups_RemovesExpiredPowerups15
PWR-06The player collects a powerup by touching it.Overlapping circles remove it and return it.TryCollect_RemovesPowerupWhenPlayerIsInRange15
PWR-07Shield adds a charge. Freeze stops enemies for 2 s. Extra Life adds a life. Fuse Reset puts out the fuse. Double Points doubles capture score for 10 s.Each effect changes only its own state.Apply_EachTypeChangesOnlyItsOwnState (one case per type)15

RUN - Runs, upgrades and the daily challenge ​

IDRequirementAcceptance checkProofCh
RUN-01A run is Classic (from level 1), Level Select (from any unlocked level) or Daily Challenge (from level 1, seeded by the date).Each main menu choice starts the matching mode.StartRun_FromLevelSelect_StartsAtChosenLevel18
RUN-02After each cleared level the player picks 1 of 3 distinct upgrades.The draft has 3 different upgrades.CreateUpgradeChoices_ReturnsThreeDistinctOptions18
RUN-03The draft is repeatable: its seed is the run seed + level x 31.The same seed and level give the same 3 cards.CreateChoices_WithSameSeed_IsRepeatable18
RUN-04Quickstep adds 15% speed. Cool Fuse adds 0.5 s before ignition. Double Down adds 25% score. Safe Return adds 0.5 s of grace. Picks stack.Two Quicksteps give x1.30.Apply_FasterMovement_IncreasesMoveSpeedMultiplier, Apply_SlowerFuse_AddsFuseDelayBonus, Apply_HigherScoring_IncreasesScoreMultiplier, Apply_SaferRespawn_AddsRespawnGraceBonus, Apply_StacksAcrossRepeatedPicks18
RUN-05Extra Life adds a life at once and is recorded with the other choices.Lives rise by 1 and ChosenUpgrades gains BonusLife.ApplyUpgrade_BonusLife_AddsALifeAndRecordsTheChoice, Apply_BonusLife_LeavesModifierAggregateUnchanged, ApplyUpgrade_HigherScoring_UpdatesRunModifiers18
RUN-06The daily seed is the UTC date's day number, taken from an injected clock.2 December 2026 gives the same seed on every machine.DailySeed_IsTheUtcDayNumber19
RUN-07DailyChallengeActive follows the run mode.It is true only for RunMode.DailyChallenge.DailyChallengeActive_FollowsRunMode19
RUN-08A daily run is fully seeded: enemies, powerups and the draft all draw from one Random built from the daily seed.The same seed and the same scripted input give the same score, positions and events.SameSeedAndInput_GiveTheSameRun19
RUN-09A finished run shows its score, the best score and the level reached.The summary reads SCORE n HI n LEVEL n.Checkpoint18

FE - Front end and scenes ​

IDRequirementAcceptance checkProofCh
FE-01The game opens on a title screen. Confirm or cancel goes to the main menu.Enter on the title shows the main menu.Checkpoint05, 17
FE-02The main menu offers Start Run, Daily Challenge, Level Select, Tutorial, Options and Quit.Each item opens its scene or starts its run.MainMenu_ConfirmOnEachItem_IssuesItsCommand17, 19
FE-03Vertical menus wrap at both ends and play the menu cue on each move.Up on the first item selects the last.MenuList_WrapsAtBothEnds17
FE-04Pause shows Resume, Options and Quit To Menu over the frozen game. Pause again resumes.The gameplay surface is drawn under the overlay and does not change.SceneManager_PushedOverlay_DrawsTheSceneBelow17
FE-05Options are opened from the main menu or the pause menu, and Back returns to the one that opened them.Back from options opened in pause returns to pause.SceneManager_Pop_ReturnsToCaller17
FE-06Level Select lists levels 1 to the highest unlocked level, without wrapping.With level 4 unlocked, the list stops at 4.LevelSelect_StopsAtHighestUnlockedLevel17
FE-07The tutorial has 5 pages. Finishing it marks it completed. Cancel leaves early.After page 5, TutorialCompleted is true.Tutorial_FinishingLastPage_MarksItCompleted17
FE-08A cleared level shows its bonus, then the upgrade draft, then the next level.Enter twice after a clear starts the next level with the chosen upgrade.Checkpoint18
FE-09Quit To Menu ends the run and records it.The run counts towards the high score.Checkpoint18

PRO - Profile and persistence ​

IDRequirementAcceptance checkProofCh
PRO-01The profile is a JSON file in the user's local application data folder, under LastPerimeter/profile.json.The file exists there after the first save.Checkpoint16
PRO-02A missing or corrupt profile loads as a fresh profile. Only file and format errors are caught.A corrupt file gives defaults.Load_ReturnsDefaultProfile_WhenFileDoesNotExist, Load_ReturnsDefaultProfile_WhenFileIsCorrupt16
PRO-03Saving writes a temporary file and swaps it in, so a crash mid-write keeps the old profile.No .tmp file is left after a save.Save_LeavesNoTemporaryFile, SaveThenLoad_RoundTripsProfileValues16
PRO-04A save that fails returns false, never throws, and is not retried every frame.Saving into an impossible folder returns false.Save_ReturnsFalse_WhenProfileFolderCannotBeCreated, SaveIfDirty_WritesOnceThenReportsClean16
PRO-05The profile is saved only when no level is being played, and once more when the game closes.No disk write happens during GameplayScene.SaveHook_NeverRunsDuringGameplay16
PRO-06Clearing a level unlocks the next one.Clearing level 3 sets HighestUnlockedLevel to 4.RecordLevelCleared_UnlocksNextLevel16
PRO-07Lifetime statistics count runs, deaths, levels cleared, the highest level, powerups, captures and the best daily score.Each recorded event raises its counter.RecordRunFinished_UpdatesDailyBestOnlyForDailyRuns, RecordedEvents_RaiseTheirCounters16, 19
PRO-08Settings are saved with the profile and applied at start-up.A changed theme is still set after a restart.SaveThenLoad_RoundTripsProfileValues16

HUD, REN and AUD - HUD, rendering and audio ​

IDRequirementAcceptance checkProofCh
HUD-01The HUD shows a claim progress bar, score, best score, level, claim percentage, goal and one icon per life.All are visible during play.Checkpoint12
HUD-02The HUD shows WARN while the fuse warns and FUSE while it burns, SAFE during grace, SLOW DRAW 2X, SHIELD:n and DOUBLE PTS while active.Each label appears only in its state.Checkpoint12
HUD-03A status line reports the last event, such as CAPTURE COMPLETE, NO CAPTURE or SHIELD BLOCK.The line changes with each event.StatusText_MapsEveryEventToALine12
HUD-04Text is drawn with a built-in bitmap font, in upper case, without allocating per call.Lower-case input draws as upper case.Checkpoint12
REN-01Every shape is drawn from one 1x1 white texture with point sampling.Lines, circles and fills render with no content files.Checkpoint02
REN-02Claimed area is drawn from a cached render target, rebuilt only after a claim or a colour change, and never inside an open sprite batch.No rebuild happens on frames without a claim.Checkpoint09
REN-03Slow-drawn claims use the palette's ClaimedSlow colour, and the slow trail is thicker (5 px against 3 px).The two kinds of claim look different.Checkpoint09
REN-04The window title shows score, lives, level and claim, and changes only when one of them changes.The title is not set on idle frames.Checkpoint12
AUD-01Six synthesised tones mark a claim, the fuse warning, a death, a menu move, a powerup and a cleared level.Each event plays its tone.Checkpoint12
AUD-02With no audio device the game runs silent instead of failing.The player reports IsSilent and play calls do nothing.Constructor_WithNoAudioDevice_RunsSilentAndPlayDoesNothing12
AUD-03Audio can be turned off, and a master volume applies to every cue.With audio off no tone plays.Configure_ClampsMasterVolume, plus a checkpoint with audio off12, 20

THM - Themes and accessibility ​

IDRequirementAcceptance checkProofCh
THM-01There are 3 themes: Neon Vector, CRT Green and Sunset Synth. Each defines 9 colour roles.Each preset gives a complete palette.Create_EveryPresetFillsEveryRole20
THM-02Colourblind mode replaces 7 roles with a palette that stays distinct for common colour vision deficiencies.With the mode on, Player, Trail, TrailSlow, Claimed, ClaimedSlow, Enemy and Accent change, and Background and Warning do not.ColorblindMode_ReplacesOnlyTheSevenRoles20
THM-03Reduced flash turns off the flashing trail during the fuse warning.With it on, the trail keeps its normal colour while warning.Checkpoint20
THM-04UI scale runs from 0.8 to 1.5 in 0.1 steps and scales HUD text.Values outside the range are clamped.UiScale_IsClampedToRange20
THM-05Settings changed in the options apply at once, including mid-run from the pause menu.A theme change shows on the next frame.Checkpoint20

NFR - Quality requirements ​

IDRequirementAcceptance checkProofCh
NFR-01The game holds 60 frames per second. Per-frame paths allocate nothing on the heap except where a chapter says so.No LINQ closures, string building or new collections in Tick, Update or Draw hot paths.Code review, profiling exercise in chapter 13all
NFR-02No disk IO happens during a level.See PRO-05.SaveHook_NeverRunsDuringGameplay (shared with PRO-05)16
NFR-03Every gameplay rule can be tested without a window or a graphics device.GameplaySimulation and every service in Systems/ reference no Game, GraphicsDevice or SpriteBatch.Code review, plus the scenario tests05 onwards
NFR-04The build has 0 warnings with nullable reference types on.dotnet build reports 0 warnings.CIall
NFR-05No service field is nullable just to allow late wiring. Per-level services are built together or not at all.LevelServices has no nullable members. The host has no null guards.Code review05, 14
NFR-06The rules for death, shields, respawn, powerup effects, level completion, upgrades and pausing have tests.Each of those rules has at least one scenario test.The scenario tests named elsewhere on this page11 to 18
NFR-07Every requirement in this file has a test or a chapter checkpoint.Chapter 21's sign-off table has no blank Proof cell.Chapter 2121

Summary by area ​

AreaRequirementsProved by a testCheckpoint, review or CI only
PLT716
ARN880
WAL660
INP532
MOV660
TRL10100
FUS880
CAP1192
ENM12120
COL330
LIV770
SCO770
LVL880
PWR770
RUN981
FE963
PRO871
HUD, REN and AUD1138
THM532
NFR716
Total15412331

A requirement counts once. It counts as proved by a test when its Proof cell names at least one test.