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 ...
Get HTML5 Game Development with GameMaker now with the O’Reilly learning platform.
O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.