This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
PlanetaryDeception is a Unity (C#) interplanetary story-driven platformer set on Venus in 2203. The player explores levels, interacts with NPCs, manages an inventory and virtual currency (solarbits), and uses an in-game terminal OS called SolarOS to hack systems and uncover a conspiracy involving Venref, Voasis, and Lunar Defense (LD).
Story document: docs/story.md
Game scripts live under Assets/scripts/. Unit tests use a separate MSBuild solution with Unity mocks.
Build:
dotnet build PlanetaryTest.sln
Run all tests (MSTest):
dotnet test PlanetaryTest.sln
Run a single test:
dotnet test PlanetaryTest.sln --filter "FullyQualifiedName~TestMethodName"
Dialog/Console Runner (preview dialogs and SolarOS without Unity):
dotnet run --project Tools/DialogRunner/DialogRunner.csproj -- flowershop
dotnet run --project Tools/DialogRunner/DialogRunner.csproj -- interrogation
dotnet run --project Tools/DialogRunner/DialogRunner.csproj -- console VenusHome
StyleCop: Configured via Settings.StyleCop — file headers and this. prefixing are disabled.
LevelBase(abstract, extendsMonoBehaviour) — base for all levels; provides collision detection, UI alerts, and static instance tracking- Level controllers (
LevelController_1,_2,_3) inherit fromLevelBaseand handle scene-specific input and transitions - Scene transitions use
CharacterSettings.TransitionToNewScene()which saves player position and loads new scenes - Chapter 1 (Levels 1-2) is fully implemented. Level 3 (Chapter 2) is an empty shell
IDialogConsole— interface withNewQuestion(),AddPossibleAnswer(),Clear()for dialog treesTinyOSimplementsIDialogConsolefor in-game renderingCliDialogConsoleimplementsIDialogConsolefor CLI preview in the DialogRunner tool- Dialog methods should be
publicand acceptIDialogConsole+Action onExitso they work in both Unity and the CLI tool - See
LevelController_2.FlowershopQA1()andLevel_2_interrogation.InitQuestions()for examples
ISolarOS— interface defining OS capabilities (menu, network, console text, breadcrumb navigation)SolarOSextendsLevelBaseand implementsISolarOS— provides menu system, breadcrumb nav, network managementTinyOSextendsSolarOS— specialized for Q&A dialog sequencesSolarOSApplication(abstract) — base for OS apps (SolarOSSocialMedia,SolarOSWeb,SolarOSGIT)SolarOSMenuItemwraps description + callback delegates (RunApplication,OnDisplay)- Web content loaded from text files in
Assets/resources/viaResources.Load()
ItemInventory— base container withAdd(),Pull(),TransferItem(),ContainsItem(),GetItemIds(),Clear()PlayerInventory— singleton for player's carried itemsKnownItemsInventory— singleton master catalog of all game items; itsTransferItem()doesn't remove from source- Items are
ItemTagobjects:KnownItemenum +ItemClassType(Trash, Identification, ProjectileWeapon, ParticleWeapon, Hidden, Ticket) - Hidden items are used as game state flags (e.g.
VenrefInterrogated,CeresInvitation,FlowershopVisited) - When adding new items: add to
KnownItemenum, add toKnownItemsInventoryconstructor
SolarbitsWallet— base currency wallet withTransfer(),Add(),GetAmount(),SetAmount(); throws on insufficient fundsPlayerWallet— singleton, initialized to 500 solarbits (PlayerWallet.StartingAmount)
SaveManager.Save()/SaveManager.Load()— serializes all game state to JSON atApplication.persistentDataPath/savegame.jsonSaveData— serializable class capturing character settings, inventory, wallet, and scene positionsJsonHelper— wrapper aroundSystem.Text.Json; swap implementation for Unity'sJsonUtilityif needed- Not yet wired into game UI
PlayerInventory, PlayerWallet, KnownItemsInventory, CharacterSettings all use the singleton pattern.
- Framework: MSTest (
Microsoft.VisualStudio.TestTools.UnitTesting) - Tests are in
Unittesting/(InventoryTests.cs, WalletTests.cs, SaveManagerTests.cs) - Unity dependencies are mocked via stub classes in
Mocks/(UnityEngine.cs, UnityEngineUI.cs, UnityEngineSceneManagement.cs) - Mock
Resources.Load()reads actual files fromAssets/resources/on disk PlanetaryMock.csprojcompiles game scripts + mocks into a library;EnableDefaultCompileItemsis false- When adding new game scripts to test, they must be added to
PlanetaryMock.csproj's<Compile>items .gitignoreexcludes*.csproj(Unity convention); tracked csproj files work fine but new ones needgit add -f
PlayerSecurityAccessCard (closet) → Console access → IOT door unlock → GIT code review → VoasisCredentials → Voasis website login → VoasisWebsiteCredentialsUsage → Interrogation → VenrefInterrogated → Social media DMs → CeresInvitation → Buy launch ticket (100 solarbits) → Launch → Chapter2