This code is a terrible mess and should be replaced as soon as possible. The tutorial has retroactively changed to facilitate new gameplay features and updates, making it a mess to navigate. This document explains how it works.

Tutorial Phases

The tutorial has five phases.

  1. Introduction(Opening in code): Introductory dialogue, transitioning the player into the scene
    1. Next Phase Trigger: Tikki Dialogue reaches the end of the introduction dialogue.
  2. Movement(StartMovementSequence in code): The player is given a group of targets to fly through in order to learn the movement controls.
    1. Next Phase Trigger: Player collides with four targets.
  3. Wormhole(StartWormholeSequence in code): Wormholes are spawned in the level, allowing the player to learn how to retrieve scrap.
    1. Next Phase Trigger: The player retrieves scrap from a wormhole.
  4. Enemy(EndSequence in code): An enemy is spawned at the tutorial's exit, allowing the player to learn how to participate in combat.
    1. Next Phase Trigger: The player defeats the enemy.
  5. Exit(ExitSequence in code): The tutorial's exit is unlocked.

These phases move linearly, moving down the list until the player eventually leaves the level. Each phase has a trigger to the next phase and a "stop number", which is how far along the dialogue it can go before it needs to stop for each phase.

Connected Scripts

TutorialNode: Attached to all the scrap nodes/wormholes in the level. Detects when the node is destroyed from being opened by the player. Sends the TutorialManager an update, which lets the TutorialManager know to begin dialogue explaining how to retrieve scrap.

TutorialScrapDetector: Attached to a UI element that only pops up when the player nears a wormhole. When the player interacts with a wormhole it disables the UI element, this script detects that and sets a variable in the TutorialManager that begins the Enemy phase.

TutorialShip: Detects when the ship has been enabled, which only happens after a wormhole gameplay sequence. When this happens it sends a message to the TutorialManager to begin the Enemy phase.