Instructions

The core class hierarchy for player and enemy instructions. Extend these to add new behaviour to the game.

📄
Instruction
Abstract base for every instruction. Defines the fields, serialized state, lifecycle events, and the Tick() method to override.
Fields OnInstructionStart Tick() Run()
🧩
PlayerInstruction
Extends Instruction for player-controlled actions. The base class to derive from when adding new sheet instructions.
ExecutionContext Stamina checks Direction support
🔄
InstructionModifier
Wraps a single child instruction and modifies how it runs — used by Invert and Rotate.
Child instruction Modified Tick()
📑
InstructionSequence
Holds multiple child instructions and executes them as a group — used by Combo and Ping Pong.
Child list Sequential execution
👹
EnemyInstruction
Base class for enemy AI behaviours. Receives an EnemyAction context instead of ExecutionContext.
EnemyAction Tick() Parallel run
ExecutionContext
The runtime snapshot passed into every Tick(). Exposes the player controller, stamina, inventory, and turn events.
player stamina inventory OnTurnEnd
📡
IExecutionSuscriber
Lightweight notification interface for enemies that need to react to each instruction step — auto-discovered from the hierarchy, no manual wiring required.
Execute() Auto-registration ShootSuscriber vs ITaskReceiver
📋
Built-in Instructions
Complete catalogue of all 19 player instructions and 5 enemy instructions — parameters, behaviour, and notes.
Move / Jump / Attack Carry / Drop / Throw Combo / Ping Pong Enemy: Shoot / Block
⚙️
Custom Instructions
CustomInstruction lets you define execution behaviour through delegates instead of subclassing — ideal for transient, runtime-generated instructions.
CustomInstruction tick / execute displayName
⏱️
Tasks
Task wraps an instruction's execution as a stoppable coroutine. ITaskReceiver is implemented by enemies and NPCs that own a per-turn task scheduled in parallel.
Task / Status Start / Interrupt ITaskReceiver
🎯
Action
MonoBehaviour bridge that pairs an instruction C# type with its InstructionLayout prefab. Lives on each draggable item in the instruction palette.
instructionType layout CreateInstruction() Palette setup
📄
InstructionSheet
Singleton that owns the instruction list, handles drag-and-drop onto the sheet, drives the execution cursor, and provides undo/redo with a 20-step history.
current (singleton) Insert / Remove Undo / Redo Load(LevelInfo)
▶️
InstructionRunner
Execution engine that cycles through instructions turn by turn, runs parallel tasks, validates player state, and fires success/failure events.
Play() / Observe() Stop() / Reset() ExecutionStatus OnTurnStart / End

Interactables

The interfaces and base class that define how world objects participate in player interactions, and the ready-made implementations you can use directly.

📦
Interactable Interfaces
IInteractable, ICarryObject, IPushable, IObstacle, and ExecutionContextElement — the full API for creating world objects the player can interact with, carry, push, and that block movement.
IInteractable ICarryObject IPushable IObstacle ExecutionContextElement
🏺
Built-in Interactables
Ready-made implementations: Pickup (auto-collect), Chest (manual), Carry (carryable crate), PushableObject (stone block), and Door (togglable obstacle with optional key).
Pickup / Chest Carry / Push Door
⚠️
Traps
Tile-based hazards that run every turn as ITaskReceiver tasks. PressurePlate reacts to occupation; AppearingSpikes cycles through configurable stages and deals lethal damage.
PressurePlate AppearingSpikes stages / OnActivated

Inventory

The runtime inventory manager and save snapshot, plus the item and equipment ScriptableObject types and the effects system.

🎒
PlayerInventory
Runtime inventory manager with item slots and equipment slots. Also covers InventoryPreset for starting loadouts and InventoryData for save serialization.
PlayerInventory TryAddItem / TryUseItem InventoryPreset InventoryData
🧪
Item
Base ScriptableObject for collectible items. Holds display name, icon, stackable flag, and a list of Effects applied when used via Instruction_Use.
displayName / image stackable ApplyEffects()
⚔️
Equipment
Extends Item with an equipment slot type and passive stat bonuses. Equipped gear contributes bonuses automatically via PlayerInventory.
Equipment.Type twoHanded StatValue / GetStatValue()
Effect
Serializable stat modification embedded in Item assets. Controls the target stat, value, duration in turns, and whether the effect applies once upfront or once per turn.
targetStat / value duration applyPerTurn

Level & Utility

Singletons and helpers for interacting with the level state, the tile grid, and the in-game notification system.

🎮
LevelManager
Central singleton for a level scene. Call Play / Stop / Reset and subscribe to lifecycle events from any script.
OnPlay / OnStop OnTurnStart / End OnLevelCompleted Play() / Reset()
LevelGoal
Abstract base for optional star-granting objectives. Subclass it to define any measurable win condition evaluated against the player's completed run.
displayText Check() LevelData Custom goals
🗾
MapManager
Spatial queries over the tile grid — snap positions to cells, look up tiles, and get the start and end tiles.
cellSize GetTile() CellPosition() startTile / endTile
💬
NotificationCenter
Spawns in-game pop-up messages. Call statically from any instruction to give the player feedback on failure.
Notify() Message / Warning / Error

Scriptable Objects

Base classes and utilities for project-wide ScriptableObject infrastructure.

📋
ItemsReferences
Master list ScriptableObject read by DatabaseManager at startup to register all Item assets into the runtime database for save-safe ID lookups.
Items (read-only list) Contains / Add DatabaseManager
🗂️
IdentifiableSO
Abstract base for ScriptableObjects that require a stable GUID-based ID across save and load cycles. Subclass it for any asset that needs to be referenced from save data.
ID (GUID) Save-safe reference Item / Equipment Subclassing
📊
Stat
Named ScriptableObject key for a character attribute. Acts as a dictionary key linking equipment bonuses, item effects, and character receivers to a shared identifier.
displayName / icon damage / defense

Audio

The three audio classes that make up the persistent sound system — settings, music crossfade, and the UI slider component.

🔊
SoundManager
DontDestroyOnLoad singleton that restores all AudioMixer parameter values from the save file on startup, and writes them back whenever a slider changes.
Set() DontDestroyOnLoad Order −100
🎵
MusicManager
Plays and crossfades background music across scene transitions. Persists for the full game session.
CrossfadeTo() DontDestroyOnLoad Per-scene clip
🎚️
SoundSlider
Thin UI wrapper — reads the current mixer value in Start() to sync the slider visually, then delegates any change to SoundManager.Set().
parameterName SetValue() AudioMixer sync

UI

MonoBehaviour components for displaying and interacting with the game UI — modal windows, live HUD bars, inventory panels, and notification pop-ups.

🪟
Window
Abstract base class for all modal panels. Toggles the GameObject on Open/Close and plays optional sound effects. Subclass it to create custom windows.
Open() / Close() openSound / closeSound Subclassing
❤️
HUD
PlayerHealthBar, PlayerStaminaBar, and HUD_ShowStatEffectNumber — live stat display components that auto-subscribe to LevelManager and player health events.
PlayerHealthBar PlayerStaminaBar ShowNumber()
🎒
Inventory UI
InventoryWindow singleton, ItemSlotLayout, EquipmentSlotLayout, and the floating equipment tooltip — the full set of inventory display widgets.
InventoryWindow.current Refresh() StatSlot Tooltip
🔔
Notifications
NotificationLayout toast pop-up with auto-dismiss, and EquipmentNotification for a persistent queue that announces newly received equipment across scenes.
CreateInstance() AddEquipment() Queue
🧩
Instruction Layouts
Widget classes that render instructions on the sheet — InstructionLayout base plus Modifier, Sequence, and Use subclasses with drag-and-drop and undo/redo support.
CreateInstance() SetDirection() Modifier / Sequence / Use ResetLayout()
↕️
Drag & Drop
DragAndDrop handles palette item drag visuals and insert-indicator updates. DropActionEventCaller is a lightweight drop zone for modifier child slots.
currentDragging dragCaptured AddDropEvent()

Components

MonoBehaviour components for character control, stats, enemy display, data persistence, world map, level screens, projectiles, visual effects, and scene utilities.

🧑
PlayerController
Root MonoBehaviour for the player prefab. Manages inventory-driven damage and defense stats, stamina, item usage visual effects, audio, and tile position validation.
damage / defense UseItem() ValidatePosition() OnExecute
👹
EnemyController
Root MonoBehaviour for enemy prefabs. Controls patrol routing, player detection, attack-sequence cycling, hover highlighting of attack range tiles, and IObstacle blocking.
GetTask() moveSequence attackSequence OnActionChange
PlayerStamina
Tracks the player's stamina resource. Exposes events for HUD updates and methods to spend or restore points from inside instructions.
Substract() / Add() OnDepleted OnReplenished
❤️
Health
Abstract base for health systems with damage, block, heal, and kill methods. PlayerHealth and EnemyHealth extend it with character-specific behaviour.
ApplyDamage() Heal() / Kill() OnDie PlayerHealth / EnemyHealth
🔁
ActiveEffectsController
Tracks all timed stat effects on the player, decrements their remaining turns, and reverts them automatically on expiry.
Track() Clear() duration > 0
👾
Enemy HUD
Four components for the in-world enemy display: health counter, animated action indicator, full action-sequence panel, and per-action layout widget.
EnemyHealthBar EnemyInstructionIndicator EnemyActionSequencePanel EnemyAction_Layout
💎
ItemDropper
Spawns a pickup at the entity's tile when it dies. Also covers ItemUsedFX, which briefly flashes an item's sprite at the use position.
Drop() OnDie wiring ItemUsedFX
💾
GameDataManager
Singleton that persists level progress, audio settings, and discovered equipment. All public members are static — no instance reference needed.
SaveLevel() GetLevelData() DiscoveredEquipment SaveNow()
🗄️
DatabaseManager
Singleton that indexes every item asset from an ItemsReferences ScriptableObject into fast type-specific lookup tables at startup.
current (singleton) ItemsReferences Type lookup
🗺️
World Map
WorldMapManager orchestrates map initialization and the level info panel. LevelMarker represents each selectable level node with star ratings and unlock chaining.
WorldMapManager LevelMarker Initialize() childs unlock
🖥️
Level Screens
Ready-made UI screens: LevelInfoScreen (world map panel), LevelGoalLayout, WinScreenController, GameOptionsMenu, and ItemsListWindow.
LevelInfoScreen WinScreenController GameOptionsMenu ItemsListWindow
⚔️
Equipment Browser
Paginated discovered-equipment panel: DiscoveredEquipmentList, DiscoveredEquipment_Layout entry widget, and StatElement/EffectElement tooltip layouts.
ShowType() Next() / Previous() CreateInstance()
🏹
Projectile
Self-propelled prefab that travels in a straight line and applies damage on the first collider it hits. Fire from a ranged instruction or via ShootSuscriber on enemies.
Shoot() speed / damage ShootSuscriber
Visual FX
SpriteExpandAnimation, SinExpandAnimation (UI breathing), HoveringMouse (scale on hover), and CloudsController (procedural drifting clouds).
SpriteExpandAnimation SinExpandAnimation HoveringMouse CloudsController
🔧
Utilities
DisableOnRunning and DisableButtonOnRunning lock UI during play. PixelSnaper snaps to pixel/grid. DepthSortingOrder drives Y-based painter's depth.
DisableOnRunning PixelSnaper DepthSortingOrder