Add another gym about scene switching
This commit is contained in:
@@ -20,6 +20,13 @@ func _ready() -> void:
|
||||
# Connect to variable changes to watch for demo variables
|
||||
Dialogic.VAR.variable_changed.connect(_on_variable_changed)
|
||||
|
||||
# Check if we're returning from the gym09 minigame
|
||||
if Dialogic.VAR.Gym.minigame_done:
|
||||
print("[Gym Controller] Returning from minigame — starting congrats timeline.")
|
||||
Dialogic.VAR.Gym.minigame_done = false
|
||||
Dialogic.start("gym09_congrats")
|
||||
return
|
||||
|
||||
# Start the hub timeline
|
||||
Dialogic.start(start_timeline)
|
||||
|
||||
@@ -49,6 +56,14 @@ func _on_dialogic_signal(argument: Variant) -> void:
|
||||
Dialogic.end_timeline()
|
||||
Dialogic.start_timeline("gym_pattern4_signal_target")
|
||||
|
||||
elif argument is String and argument == "start_minigame":
|
||||
# Gym 09: Scene switching demo
|
||||
# Store the return path so the minigame knows where to come back to
|
||||
Dialogic.VAR.Gym.minigame_return = "hub"
|
||||
print("[Gym Controller] Signal 'start_minigame' — switching to minigame scene.")
|
||||
await get_tree().create_timer(0.3).timeout
|
||||
get_tree().change_scene_to_file("res://docs/gyms/gym09_scene_switching/gym09_minigame.tscn")
|
||||
|
||||
#endregion
|
||||
|
||||
|
||||
|
||||
@@ -50,7 +50,24 @@ Miko (neutral): Which pattern would you like to explore?
|
||||
Miko (joy): The variable itself is the jump target!
|
||||
jump gym_pattern8_dynamic_label/start
|
||||
|
||||
- More patterns...
|
||||
Miko (smile): There's more to explore on the next page!
|
||||
jump menu_p2
|
||||
|
||||
- I've seen enough. Goodbye!
|
||||
Miko (smile): Thanks for exploring! Come back anytime.
|
||||
Advisor (pl5): Until next time.
|
||||
[end_timeline]
|
||||
|
||||
label menu_p2
|
||||
|
||||
Miko (neutral): More patterns to explore:
|
||||
|
||||
- 9. Scene switching (Dialogic ↔ gameplay)
|
||||
Miko (smile): This one changes scenes — a timeline, then a minigame, then back!
|
||||
Advisor (pl5): I'll take you to the intro, which will trigger the minigame.
|
||||
Miko (neutral): Press the button 5 times to return.
|
||||
jump gym09_intro/
|
||||
|
||||
- Back to first page
|
||||
jump menu
|
||||
|
||||
Reference in New Issue
Block a user