Adding in the collision sounds
Everything is functioning, though a bit boring, due to the lack of sound. The Debris being destroyed so quickly is also not very satisfying. Let's fix both of these issues.
First we need to bring in some sounds. Create a new Sound,
snd_Shatter_Glass
, and loadChapter 6/Sounds/Shatter_Glass.wav
. The default values will work, just make sure that Kind is set to Normal Sound. This effect will be for when the Glass breaks apart.We also want a sound for when the Glass Pillars do not break. Create another new Sound,
snd_Impact_Glass
and loadChapter 6/Sounds/Impact_Glass.wav
.Repeat this process for the Wood and Steel sound effects.
We need to initialize some variables, so reopen
scr_Pillar_Glass_Create
and add the following at the end of the script:impact = snd_Impact_Glass; shatter = snd_Shatter_Glass; isTapped = false; isActive = false; alarm[0] = room_speed;
We start by assigning variables to the
Impact
andShatter
sounds. We will only want to allow the impact sound...