5
Luis Vazquez IG3 Assignment Task 2

Ig3 task 2 annotation

Embed Size (px)

Citation preview

Page 1: Ig3 task 2 annotation

Luis Vazquez IG3 Assignment Task 2

Page 2: Ig3 task 2 annotation

Luis Vazquez IG3 Assignment Task 2

The first step I took to add a sound to a Game Maker project is to open the Resources > Create Sound tab, which will bring up a window with an option to name the sound that I added to the program, as well as an option to open a sound from a file to load into the project.

I then selected the option to load a sound into the project, which opens a windows explorer tab:

Page 3: Ig3 task 2 annotation

Luis Vazquez IG3 Assignment Task 2

Once I’ve selected the sound and named it (in this case I have loaded Retro Sound Effect 6 – Main Menu Music and have named it Level_BG, as I intend to use it as the background music for the game.

Page 4: Ig3 task 2 annotation

Luis Vazquez IG3 Assignment Task 2

Now to have the sound appear in game, I attach it to an ‘Event’ in the program logic. In this case, the sound file is attached to an invisible object called b_sound in the create event, which causes the music to play as soon as the object spawns in the game world, which is at the beginning of the game.

I want the background sound to play in a loop, as opposed to only occurring on one occasion at the beginning of the game, so I set loop to ‘true’.

Page 5: Ig3 task 2 annotation

Luis Vazquez IG3 Assignment Task 2

Although I have chosen the background music to loop, I want it to have an end point, which in this case is the ‘death’ of the player character when the game ends. To cause this to happen, I have added a function to the explosion object that occurs when the player loses, which stops the background music when it is created in the game space.