Audio Overlapping


Author: Ethan Ortega

Problem: When doing the piano puzzle there was an issue where the key audio and fail audio would play at the same time. When you stepped on the wrong key it would first play the audio when u stepped on the wrong key and then shortly after play the audio of the key. This would be confusing to the player to alert them if they have stepped on the wrong or right key. I figured out the issue stemmed from when I first handled the audio since I didn't separate fail and success audio.

Solution: To solve the issue I switched the audio from being handled by the keys individually to being handled by the piano. Before each key would lay its own sound when the player collided with it. Now, when the player collides with the key it sends its audio to the piano object, and the piano handles which audio to play. If you click the correct key it plays the last audio received once but if you fail it plays the fail sound and resets all variables dealing with the piano keys.

Below you can see the top part of the branch plays the last sound for the key interacted with if it's correct then check for the win condition. If the key is incorrect it hits the bottom part of the branch and plays the error noise while also handling the audio from the keys.

Leave a comment

Log in with itch.io to leave a comment.