This file provides guidance to Claude Code (claude.ai/code) when working with code in this repository.
VampireDrama is a 2D roguelike vampire game built in Unity 6.3 LTS (6000.3.10f1). The player controls a vampire navigating city streets, avoiding detection and sunlight, and feeding on humans to progress through levels.
This is a Unity project — open it in Unity 6.3 LTS (6000.3.10f1) to build and run.
There is a separate .NET solution (VampireDramaMock.sln) for out-of-Unity testing:
dotnet test VampireTest/VampireTest.csproj # run MSTest unit tests
dotnet run --project VampireConsole # CLI map generator/viewerThe test project uses mock Unity APIs (UnityMocks/) so map generation logic can be tested without the Unity editor.
Namespace: All game code lives in the VampireDrama namespace.
- Game/ —
GameManager(singleton, level init/scene transitions),GameGlobals(singleton, persistent player state viaPlayerStats,GhoulPack),SceneManager(extendsLevelConstruction, manages level UI),GameInput(singleton, new Input System wrapper),AbilityUI(HUD component for ability display),LevelState(hidden per-level stats: wanted/reputation/influence) - Map/ — Procedural level generation.
Mapbuilds chunk-based levels from 12x12 templates inAssets/Resources/6x6/.ConstructionTypes.csdefines terrain enums.ChunkPresetsholds pre-designed templates.MapTestvalidates path traversability. - Player/ —
VampirePlayer(extendsMovingAnimation) handles input, combat, feeding, inventory, and abilities.MovingObjecthandles physics/raycasting.Inventorymanages a 2-slot item system.Abilitybase class withAbilitySetfor cooldown-based abilities. Concrete abilities:GlamourAbility,RecruitGhoulAbility,MindControlAbility. - Blood/ —
Human(extendsMovingAnimation) is the NPC AI with A* pathfinding, suspicion mechanics, and resistance calculations. - Effects/ — Buff/debuff system:
HolyAura,SelfHealing,SunEffect.PossibleEffectsenum defines available effects. - Ghoul/ —
Ghoul(individual ghoul with blood tax timer and task),GhoulPack(collection of up to 3 ghouls),GhoulTask/GhoulTaskType(extensible task system),GhoulIntel/IntelReport(intel gathering with escalating wanted-level reports). - AStar/ — Embedded Roy-T.AStar pathfinding library.
PathFinderwith MinHeap,Grid/Position/Offsetutilities. - Scene/ —
ScoreScene,GameOverScene,UiRolloverfor UI transitions,LevelConstruction(base class for level setup, human spawning, line-of-sight queries).
MovingObject → MovingAnimation → VampirePlayer / Human
Ability → GlamourAbility / RecruitGhoulAbility / MindControlAbility
Uses the new Unity Input System package (com.unity.inputsystem). All input is routed through GameInput singleton with standalone InputAction objects. Legacy InputManager is disabled.
| Action | Keyboard | Gamepad | Method |
|---|---|---|---|
| Move | WASD / Arrows | Left stick / D-pad | GetMoveInput() |
| Jump | Left Ctrl | South (A/X) | JumpPressed() |
| Interact | Left Alt | East (B/O) | InteractPressed() |
| Cycle Ability | Left Shift | West (X/Square) | CycleAbilityPressed() |
| Use Ability | Space | North (Y/Triangle) | UseAbilityPressed() |
| Confirm | Left Ctrl | South (A/X) | ConfirmPressed() |
GameManager → LevelConstruction.InitScene() → Map selects random ChunkPresets → tiles instantiated from prefabs → humans spawned on roads → items placed randomly.
Level size scales with progression: height = (level+1)*12, NPC count = (lineCount/6) + (level-1)*2 + extraLawEnforcement.
- Persistent (in
GameGlobals):PlayerStats(bloodfill, XP, items, abilities),GhoulPack - Per-level (in
LevelConstruction):LevelState(wanted, reputation, influence)
- Never revert scene files (.unity) or prefabs (.prefab) without asking. Unity may have saved runtime or editor changes to these files that are intentional. Always confirm with the user before discarding changes to Unity asset files.
Maps live in Assets/Resources/ as .txt files editable with a text editor or REXPaint (use CTRL+T to re-export). Character mappings are in Assets/Scripts/Map/ConstructionTypes.cs.
Unity YAML files can be parsed with unityparser: uv run --with unityparser python3 script.py. See docs/unity-yaml-editing.md for full usage guide and tools/add_ability_ui.py for a working example.
See the docs/ directory for detailed documentation:
docs/mechanics.md— all implemented game mechanics with formulas and valuesdocs/hud.md— HUD and display elements breakdowndocs/development.md— development requirements and map editing instructionsdocs/README.md— game premise and description