Add another gym about scene switching

This commit is contained in:
2026-06-17 00:23:25 +02:00
parent 99a7068e12
commit 00cc70df12
14 changed files with 308 additions and 0 deletions

View File

@@ -0,0 +1,27 @@
# Gym 09 — Scene Switching
Demonstrates switching between a Dialogic timeline scene and a non-Dialogic gameplay scene.
## Flow
```
gym09_main.tscn gym09_minigame.tscn
┌─────────────────┐ ┌──────────────────┐
│ gym09_intro.dtl │ │ Press button 5x │
│ ↓ │ │ ↓ │
│ [signal] │ ───→ │ set variable │
│ │ ←─── │ change_scene back │
│ gym09_congrats │ │ │
│ .dtl │ └──────────────────┘
└─────────────────┘
```
## How to Run
Open `gym09_main.tscn` in the Godot editor and press **F6** (Run Current Scene).
## Key Mechanic
- `Dialogic.VAR.Gym.minigame_done` acts as a flag between scenes
- `[signal arg=start_minigame]` triggers `get_tree().change_scene_to_file()`
- The controller's `_ready()` checks the flag to know which timeline to start