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.

  1. First we need to bring in some sounds. Create a new Sound, snd_Shatter_Glass, and load Chapter 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.
  2. We also want a sound for when the Glass Pillars do not break. Create another new Sound, snd_Impact_Glass and load Chapter 6/Sounds/Impact_Glass.wav.
  3. Repeat this process for the Wood and Steel sound effects.
  4. 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.