12345678910111213141516171819202122232425262728293031323334353637383940414243 |
- extends Node
-
- onready var mini_game = $MiniGame;
-
- onready var dialogic_node: DialogicNode;
-
- func _ready():
- dialogic_node = Dialogic.add_as_child_of($Control)
- $Control.move_child(dialogic_node, 0)
- dialogic_node.connect('dialogic_signal', self, "_on_Dialogic_signal_received")
- #dialogic_node.start_from_save("_start")
- dialogic_node.start("_start")
-
-
- func _on_Dialogic_signal_received(value: String):
- print("signal received")
- var args = value.split(" ")
- if args.size() > 0:
- var type = args[0];
- match type:
- "start_minigame":
- start_minigame()
- "setup_minigame":
- if (args.size() >= 3):
- setup_minigame(args[1], args[2], args[3])
- else:
- print("not enough arguments for start_minigame")
- _:
- print("wrong type")
-
-
- func setup_minigame(mode: String, next_timeline_lose: String, next_timeline_win):
- mini_game.setup(mode, next_timeline_lose, next_timeline_win)
-
-
- func start_minigame():
- mini_game.start()
-
-
- func _on_MiniGame_game_over(next_timeline: String):
- print("Game over received")
- print("next timeline: " + next_timeline)
- dialogic_node.start(next_timeline)
|