Labels

Wednesday 7 May 2014

Implementing Audio

Once we had a library of sounds the next thing to do was to begin implementing them into the game. For most of the elements that required sound it was simple to implement. This was due to only having to add a few lines of code to existing switches to get the sounds to also play when an event was triggered. However for the background ambient sounds and game music the scripting was slightly for complex as it required each audio clip to fade out or in depending on the level that you are in. Below is a screenshot of the audio sources for the music and ambient sounds.


The code for the music and ambient sound was however still fairly simple. Each audio clip has their volume interpolated to a set target which occurs when the player enters specific trigger points. Below is a screenshot of the script for the sound transitions.



No comments:

Post a Comment