Skip to content

Quick Start - LINX Modes System

In 2 minutes: how the modes system works and how to use it


⚡ In 30 Seconds

1 file controls everything:
  src/game/config/game-modes-config.ts

Change enabled: false → mode disappears!

Each mode is isolated:
  modes/classic/    ❌ can't disable
  modes/fractal/    ✅ can disable
  modes/ascension/  ✅ can disable
  modes/temporal/   ✅ can disable

🎮 How to Disable a Mode

Step 1: Open config

bash
# Open file:
src/game/config/game-modes-config.ts

Step 2: Change enabled

typescript
export const GAME_MODES_CONFIG = [
  {
    id: "classic",
    enabled: true, // ← CAN'T change (isBase: true)
  },
  {
    id: "fractal",
    enabled: false, // ← DISABLE (was true)
  },
  {
    id: "ascension",
    enabled: true,
  },
  {
    id: "temporal",
    enabled: false, // ← DISABLE (was true)
  },
];

Step 3: Done!

bash
pnpm dev
# → Menu will show only Classic and Ascension
# → Fractal and Temporal will NOT load

📁 Structure (Visual)

src/game/territory/

├── shared/            ← SHARED BASE
│   ├── systems/
│   │   └── BaseGameScene.ts
│   └── types/
│       └── GameTypes.ts

└── modes/             ← ISOLATED MODES
    ├── classic/      ❌ Can't disable
    ├── fractal/      ✅ Can disable
    ├── ascension/    ✅ Can disable
    └── temporal/     ✅ Can disable

Rule: Modes do NOT import each other!


🔄 What Happens When Disabling

Disabled Fractal Mode

game-modes-config.ts:
  fractal: enabled: false



phaser.config.ts:
  ...(isModeEnabled("fractal") ? [FractalModeScene] : [])
  //  false                           → []
  // FractalModeScene NOT loaded!



MainMenuUIv2.vue:
  v-for="mode in enabledModes"
  // fractal NOT in list
  // Card NOT rendered



RESULT:
  ❌ No card in menu
  ❌ No scene in Phaser
  ❌ Smaller bundle size
  ✅ Other modes work!

🎯 Use Case Scenarios

Development - working on Fractal

typescript
classic: true,    // Keep for comparison
fractal: true,    // Developing
ascension: false, // Disabled
temporal: false   // Disabled

Result: Focus on 2 modes, fast compilation

Demo - showing to investor

typescript
classic: true,   // Baseline
fractal: true,   // WOW-factor!
ascension: false,// Not ready
temporal: false  // Not ready

Result: Show only finished work

Production - release

typescript
classic: true,    // ✅ Ready
fractal: true,    // ✅ Ready
ascension: true,  // ✅ Ready
temporal: false   // ⏳ In development

Result: Release 3 modes, 4th later


📊 Current Status

✅ Ready

  • Folder structure (shared + modes)
  • BaseGameScene (abstract class)
  • 4 mode scenes (stubs)
  • game-modes-config.ts
  • Dynamic loading in Phaser
  • Dynamic menu
  • Documentation 35k+ words

🚧 In Progress

  • Classic Mode (needs migration from TerritoryGameScene)

⏳ TODO

  • Fractal Mode (CollapseSystem)
  • Ascension Mode (AbilitySystem)
  • Temporal Mode (TimeControl)

🚀 Next Steps

bash
# 1. Check it works
pnpm dev
# → Should open menu with 4 cards

# 2. Try disabling a mode
# Open: src/game/config/game-modes-config.ts
# Change: fractal enabled: false
# Restart: pnpm dev
# → No Fractal card in menu!

# 3. Re-enable
# fractal enabled: true
# → Card is back!

🎯 What's Next?

Immediate

  1. Test disable system
  2. Migrate Classic Mode
  3. Ensure baseline works

Short-term

  1. Implement Fractal Mode (NANO→MICRO)
  2. Show collapse transition (wow!)
  3. Gather feedback

Mid-term

  1. Implement remaining modes
  2. OR focus on best per feedback

📚 Documentation

Start here:

  1. MVP Philosophy ⭐ - why all this
  2. Mode Toggle System - how to enable/disable

Details:

  1. Multi-Scale Concepts - concepts
  2. Implementation Summary - roadmap

System ready! Can start implementation! 🎮🌊

MIT Licensed