Adding the finishing details to the game

The game is now functionally complete, but it doesn't have any polish or the finishing details we would expect of a full game. There is no music, no background art, and no explosions! Let's fix that right now.

Adding the game music

We want the music to start at the beginning and play for the duration of the game. When the win/lose condition occurs, we want the music to fade out to let the player know that the game is over.

  1. Create a new Sound and name it snd_Music.
  2. Load Chapter 3/Sounds/Music.mp3. Kind should be set to Background Music.
  3. Reopen scr_Overlord_Create. Since the Overlord controls the overall game, we will use it to control the music as well. After the last line of code, add the following:
    sound_play(snd_Music); ...

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.