Time for action – adding a soundtrack
The game file to import and load for this session is 5961_08_04.stencyl
.
Download Stencyl Book Sound Track from StencylForge, then close the tabs for the soundtrack and StencylForge.
Open the Sound Management scene behavior and create a new hidden Boolean attribute (not a game attribute) called
Sound Track Playing
.Add a new custom event to the Sound Management behavior, called
Play Sound Track
, and configure it as shown in the following screenshot:Open the Main Menu scene and add a new when created event (click on the gray Events button at the top of the main panel, then click on +Add Event | Basics | When Creating).
Rename the event to
Trigger Sound Track
and configure it as shown in the following screenshot:Test the game play the game and enjoy the soundtrack!
What just happened?
We've added a soundtrack, which plays automatically when the game first loads!
After downloading the soundtrack from StencylForge, we created a new Boolean attribute in the Sound...