Appearance
Appendix - Where to Take the Game Next
Where this appendix fits: the course is finished and the game is published. This appendix is a menu of larger things you could build next, each one tied to the code you already have.
The Extensions list at the end of each chapter holds exercises you can finish in an evening. The ideas here are bigger than that. Each one is a project of its own, and most of them touch more than one system. None of them is built in the course repository, so there is no snapshot to copy and no test count to match. From here on the design is yours.
Every entry answers the same four questions, so you can compare them before you commit to one:
- What it is, in a sentence or two.
- Builds on, which names the real files and types it starts from.
- Change first, which is what has to move before the feature can exist.
- First step, which is small enough to finish and prove in one sitting.
Pick a direction
| If you want | Go to | Starts from |
|---|---|---|
| cleaner code before anything large | Restructure the game class | Source/Game/LastPerimeterApp.cs |
| runs that play out the same way every time | Fully seeded runs | EnemySystem, PowerupSystem |
| to watch or race a past run | Replays and ghosts | InputState, InputManager |
| players comparing scores | Shared challenges and leaderboards | GameSession.DailyChallengeSeed, GameLaunchOptions |
| two players on one screen | Local multiplayer | InputManager, Player, TrailSystem |
| the game on more devices, or in a store | More platforms and stores | Platforms/, Resources/Identity.props |
| real art, fonts and sound | Art and audio through the Content Builder | Content/, BitmapTextRenderer, AudioCuePlayer |
| a threat on the wall itself | A wall-walking enemy | PlayableWallPath, MovementSystem |
| progress that lasts between runs | Upgrade trees and permanent unlocks | RunModifiers, PlayerProfile |
| balance decisions backed by numbers | Tuning from recorded runs | PlayerStatistics, ProfileTracker |
| controls that suit every player | Remappable controls | InputManager, GameSettings |
Three of these make the others easier. A restructured game class makes every large feature simpler to test. Fully seeded runs are the base for replays, shared challenges and leaderboards. A versioned profile, described under upgrade trees, protects anything new you decide to save.
Restructure the game class
What it is. LastPerimeterApp is both the MonoGame host and the owner of the gameplay rules. Splitting those two jobs gives you rules that a test can drive without opening a window.
Builds on. Source/Game/LastPerimeterApp.cs, and findings F18 and F26 in SOLID_REVIEW.md, which describe the problem in detail. The game class keeps many nullable system fields, and UpdateGameplay and DrawGameplaySurface each begin with a guard that silently skips the frame if any of them is null.
Change first. Group the systems that SetupLevel rebuilds for each level into one object, so that they are either all present or all absent. Then move the gameplay rules (movement, trail, fuse, claim, death and powerups) out of the host into their own class.
First step. Create the per-level object and have SetupLevel build it. That one change removes the null guards and changes no behaviour, so the 73 tests are your proof that nothing broke.
Fully seeded runs
What it is. A run in which every random decision comes from one seed, so the same seed and the same inputs always produce the same game. Today the daily challenge seeds the upgrade cards and nothing else.
Builds on. GameSession.DailyChallengeSeed, and the constructors EnemySystem(Random? random = null) and PowerupSystem(Random? random = null). Both systems already accept a Random, and PowerupSystemTests already passes a seeded one. LastPerimeterApp constructs both with no argument.
Change first. The two systems are created once, when the game starts, and a seed belongs to a run. They need to be created, or handed a new Random, at the start of each run.
First step. In StartRun, build one Random from the daily seed and give it to both systems for a daily run. Then write a test that runs two EnemySystem instances with the same seed for a few hundred updates and compares the enemy positions.
Replays and ghosts
What it is. A replay records a run and plays it back. A ghost draws a recorded run on top of a live one, so you can race your own best attempt.
Builds on. InputState, which is already one small snapshot per frame, and InputManager.GetCurrentInput, the only place input enters the game. UpdateGameplay(gameTime, input) already takes that snapshot as a parameter.
Change first. The run must be fully seeded (above), and the frame time must be recorded with the input, because movement is scaled by deltaTime. Playback is far easier once the rules live outside the host class.
First step. Record the InputState and the frame time of every gameplay update into a list, and write the list to a file when the run ends. Then feed that file back in place of InputManager and check that the run ends with the same score.
Shared challenges and leaderboards
What it is. Social features that need no second player on the sofa: "play this seed", a score you can send to a friend, and in time an online table of daily scores.
Builds on. The daily challenge from chapter 14: RunMode.DailyChallenge, GameSession.DailyChallengeSeed, the DAILY SEED status line and PlayerStatistics.BestDailyChallengeScore. GameLaunchOptions already parses one command-line option and is the natural home for another.
Change first. Scores are only comparable when runs are fully seeded. A leaderboard also needs a server, and a way to reject scores that were never played. A recorded replay is the usual answer to that, because the server can replay the run and check the result.
First step. Add a --seed option to GameLaunchOptions that starts a run with a chosen seed and shows it in the status line. Two people who agree on a number can then play the same challenge with no server at all.
Local multiplayer
What it is. Two players on one screen, either working together to claim the arena or competing for the larger share of it.
Builds on. InputManager.GetCurrentInput(PlayerIndex playerIndex = PlayerIndex.One), which already takes a player index for the gamepad. Player, PlayableWallPath, TrailSystem, FuseSystem and CollisionSystem hold the rules a second player has to obey.
Change first. The game assumes one of everything. GameSession has a single Player, TrailSystem has a single active trail, and there is one fuse. Each of those becomes one per player. Then come the design questions with no answer in the current code: what happens when two trails cross, who scores a capture that closes around the other player, and whether lives are shared.
First step. Add a second Player who can only walk the wall. Read their input with PlayerIndex.Two, move them with MovementSystem.TryMoveAlongPath, and draw them in a new palette role. That proves the input and rendering paths before you touch the trail rules.
More platforms and stores
What it is. The game on more devices than the desktop builds from chapter 15, and after that in a store where players can find it.
Builds on. The layout from chapter 01: one project per platform under Platforms/, all compiling the same code in Source/. Resources/Identity.props holds the name, the application id and the two version numbers for every platform. Resources/macOS/ already contains an Info.plist, an icon and a build target that writes the filled-in Info.plist into the publish output. That is the starting point for a macOS app bundle.
Change first. ApplicationId in Resources/Identity.props is still the template's placeholder, com.companyname.lastperimeter, and the comment beside it says to change it before publishing to any store. Beyond that, each new platform questions an assumption. InputManager reads a keyboard and a gamepad, so a phone needs touch input. GameConfig fixes the screen at 1024 by 768. ProfileStorage saves under the local application data folder, which each platform maps differently.
First step. Run dotnet new monogame --help to see which platforms your version of the template offers. Create a throwaway project with one extra platform, and compare its Platforms/ folder with yours to see exactly what a new platform adds. For packaging and store submission, follow the MonoGame documentation for your target, because the rules differ for each store.
Art and audio through the Content Builder
What it is. Real sprites, fonts, music and recorded sound effects in place of rectangles, a built-in pixel font and synthesised tones.
Builds on. The Content/ folder, which is the MonoGame Content Builder project. Raw assets go under Content/Assets/ and are registered in Content/Builder/Builder.cs. The platform builds already run the Content Builder, which is why a publish reports 0 succeeded, 0 failed today. On the game side, BitmapTextRenderer, PrimitiveDrawing and AudioCuePlayer are the three classes that stand in for assets.
Change first. Chapter 01 made a deliberate "no assets" decision, and this is where you revisit it. The renderers take a single white pixel texture and a colour. A sprite-based renderer needs textures, and you must decide how sprites take their colour from ThemePalette so that themes and the colourblind override keep working.
First step. Add one sound file, register it, load it with Content.Load<T>, and play it for one cue in AudioCuePlayer. One asset proves the whole pipeline from file to speaker, including the published build.
A wall-walking enemy
What it is. A patroller that travels along the wall, in the style of the sparks in the classic arcade games of this genre. It is the first enemy that makes the wall itself unsafe.
Builds on. PlayableWallPath and its Nodes, and MovementSystem.TryMoveAlongPath, which already moves the player along that path. LevelProgressionSystem.CreateLevel decides which enemies a level has.
Change first. The fairness contract from chapter 07 says the wall is safe and drawing is dangerous, and CollisionSystem is written to that rule. A wall enemy breaks it on purpose, so the player needs a new way to stay safe. The wall path is also rebuilt after every capture, so a patroller must be snapped back onto it with PlayableWallPath.Snap.
First step. Make a patroller that walks the path and survives a capture, with no collision at all. Add the collision only once its movement is solid, and give the level data a way to switch it on.
Upgrade trees and permanent unlocks
What it is. Progression that outlasts a single run: upgrades that lead to other upgrades, a shop between levels, or abilities that stay unlocked for good.
Builds on. RunModifiers, RunUpgradeChoice and PowerupSystem.CreateUpgradeChoices for the run layer, and PlayerProfile with ProfileStorage for anything permanent. Chapter 13 drew the line between the two layers, and a permanent unlock belongs on the profile.
Change first. Give the profile a version before you save anything new in it. Add a Version property to PlayerProfile and a migration step in ProfileStorage.Load, so an old file is upgraded on purpose and never by accident. Upgrades also stack with no ceiling today, and chapter 13 showed where that breaks, so caps come before a deeper tree.
First step. Add the Version property and a test that loads a profile saved without one. Then add a single permanent unlock and check that it survives a restart.
Tuning from recorded runs
What it is. Balance changes chosen from evidence. The game records what happened in each run, and you read the numbers before you touch a constant.
Builds on. PlayerStatistics and ProfileTracker, which already count runs, deaths, captures, powerups and levels cleared across the life of a profile. Most of the dials are already data: GameConfig, the formulas in LevelProgressionSystem and the increments in RunModifiers.
Change first. Lifetime totals hide the detail that tuning needs. You want one record per run, with the level reached, where the deaths happened and which upgrades were chosen. GameSession.ChosenUpgrades already holds the last of those.
First step. When a run finishes, append one line for it to a local file beside profile.json. After twenty runs, open the file and look for the level where most runs end.
Remappable controls
What it is. Letting each player choose their own keys and buttons, which matters most to the players who cannot use the defaults.
Builds on. InputManager, where every key and button is named in one method, and GameSettings, which is already saved with the profile. The options menu from chapters 12 and 15 is where the new rows go.
Change first. The keys are written directly into GetCurrentInput. They need to move into a table that the method reads, with the current keys as its defaults.
First step. Move the keys into that table without adding any menu, and confirm the game plays exactly as before. The menu row that changes one binding comes after.

