No Description
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

Main.gd 1.1KB

12345678910111213141516171819202122232425262728293031323334353637383940414243
  1. extends Node
  2. onready var mini_game = $MiniGame;
  3. onready var dialogic_node: DialogicNode;
  4. func _ready():
  5. dialogic_node = Dialogic.add_as_child_of($Control)
  6. $Control.move_child(dialogic_node, 0)
  7. dialogic_node.connect('dialogic_signal', self, "_on_Dialogic_signal_received")
  8. #dialogic_node.start_from_save("_start")
  9. dialogic_node.start("_start")
  10. func _on_Dialogic_signal_received(value: String):
  11. print("signal received")
  12. var args = value.split(" ")
  13. if args.size() > 0:
  14. var type = args[0];
  15. match type:
  16. "start_minigame":
  17. start_minigame()
  18. "setup_minigame":
  19. if (args.size() >= 3):
  20. setup_minigame(args[1], args[2], args[3])
  21. else:
  22. print("not enough arguments for start_minigame")
  23. _:
  24. print("wrong type")
  25. func setup_minigame(mode: String, next_timeline_lose: String, next_timeline_win):
  26. mini_game.setup(mode, next_timeline_lose, next_timeline_win)
  27. func start_minigame():
  28. mini_game.start()
  29. func _on_MiniGame_game_over(next_timeline: String):
  30. print("Game over received")
  31. print("next timeline: " + next_timeline)
  32. dialogic_node.start(next_timeline)