24th april

Sounds have began to be added to functions, this is done by calling the play function and passing in the name of the required sound effect. The image on the left shows the jump function calling the jump sound from the sound manager.
Scene detection has been added to the sound manager so that the correct music can be played. If the sound manager is within a level, the level music is played. If the sound manager is within the main menu, the menu music is played. Since the scene check must run every frame, a boolean is used to only play the music once. Without this boolean the music would be played from the beginning every frame.
​
Code has been added to detect when a scene changes. This makes sure that the level music does not restart when changing between levels and to stop music when changing between the main menu and levels.


A seperate sound manager has been created to handle some specific user interface sounds. This is only used to add sound effects to buttons within the game UI. A separate manager allows the gameUI prefab to hold it's own sound effects.


A simple script has been created to detect a collision between two objects. On collision, a quiet sound is played. This is attached to the player and duplicate objects.