Flappy Pig – Background Music and SoundFX
Day 079 #100DaysOfCode
Day 043 #100DaysOfGameDev
Having watched Flappy Pig fly in silence for too long now, it was time to do something about that.
Adding background music was the easy part: create a new GameObject, add the AudioSource component, then assign the background music asset as the AudioClip.
![](https://i0.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/02/2020-02-20Unity_background_music.png?fit=800%2C183&ssl=1)
The sound effects based on Flappy Pig himself, colliding with an object and flapping his wings, were implemented without much difficulty, but hitting the ground and scoring a point did not work as expected. Those, it seems, will require something else to make them work. I will tackle that problem tomorrow.
![](https://i0.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/02/2020-02-20notepad_FlappyPig-part1.png?resize=800%2C386&ssl=1)
![](https://i0.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/02/2020-02-20notepad_FlappyPig-part2.png?resize=800%2C208&ssl=1)
![](https://i2.wp.com/gamedev.sinwyrm.com/wp-content/uploads/2020/02/2020-02-20notepad_FlappyPig-part3.png?fit=800%2C341&ssl=1)