Voiceover Manager for beginning and ending "cutscenes" - AeTR/TouchNothing GitHub Wiki

While there are no true cutscenes in this game, there are two moments of voiceover with subtitles. When the game is first booted up, as well as when the player beats the game, voiceover audio plays, accompanied with subtitle text on the screen, showing what the voiceover is saying. To accomplish this, I broke up these two monologues into thirteen lines and six lines respectively. I then recorded the audio for each of these lines individually using audacity and added in whatever sound effects I needed from FreeSound.org. Once I did this, I added these audio files to the game. I made a piece of code called the Monologue Manager, as well as an empty game object to hold it. The Monologue Manager has an audio source, as well as an array of strings and an array of audio clips. The Monologue Manager also has access to two different Text objects, one to show the actual dialogue, and one at the bottom of the screen to let the player know they can click the mouse to continue on to the next piece of dialogue. Once the player reaches the final line of the monologue, the “click to continue” text at the bottom of the screen changes to “click to begin” if the monologue is meant to be the opening to the game (this is kept track of by the “opener” boolean variable), and “press esc to quit” otherwise. The Monologue Manager has an int that starts at 0, keeping track of which line of dialogue the player is currently on. When they click their mouse, that number goes up, then the Monologue Manager makes the text on screen display the transcript/subtitles from the next line of dialogue, and the Manager’s audio source plays a one-shot clip of that audio, using the int to find the correct line in the respective arrays.