Sound game maker explanations

15
First of all, I imported all of my sound assets. I discovered that only one .mp3 sound can play at any one time, so I imported most of my sounds in .wav format, as this would all for multiple sounds to play and overlap. The file size as also smaller. Mp3 was a better choice for my background music though, which plays throughout the game. To import a sound, I clicked on the audio icon near the top of the screen.

Transcript of Sound game maker explanations

Page 1: Sound game maker explanations

First of all, I imported all of my sound assets. I discovered that only one .mp3 sound can play at any one time, so I imported most of my sounds in .wav format, as this would all for multiple sounds to play and overlap. The file size as also smaller. Mp3 was a better choice for my background music though, which plays throughout the game. To import a sound, I clicked on the audio icon near the top of the screen.

Page 2: Sound game maker explanations

The first sound, ‘Doors_open’ plays when you start a new game. The easiest way to do this was to put it in a left click event for the ‘play_game_obj’. I put this in a release event instead of a press event so that the sound plays immediately after the user clicks the button, and not before. I also put the change room action in here so that everything happens much more swiftly than it would if it were in the Left Pressed action.

Page 3: Sound game maker explanations
Page 4: Sound game maker explanations

I wanted a shooting sound whenever an enemy bullet was fired. As bullets are created and shot through a timer at differing intervals, the easiest way, was to put the enemy_guns sound in with the same event that controls bullet creation. There was no need to add an action to stop the sound as the sound is already very short, so I just made just it was set not to loop.

Page 5: Sound game maker explanations
Page 6: Sound game maker explanations

The background music needed to play from the start of the game all the way until the user closed the game. So this would only require one audio action set to loop. I could have placed this action in any object on the main menu, but I wanted to keep things simple and put it in an object of it’s own. For this purpose, I created a control object- in it’s create event, this is where I put the audio action for the background music. I placed this object in the room editor for the main menu so that it is one of the first objects created. As audio in game maker is not limited by rooms, the music automatically continues to play even when the user clicks on any of the buttons, and until the user quits the game.

Page 7: Sound game maker explanations

At first I thought this could be quite tricky to do but it wasn’t actually that hard at all; I needed the sound to play only as the text was being typed out on the screen- as this was supposed to give the impression of a kind of digital typing sound. For this I simply make a variable ‘message1_sound’, and using booleon expressions ‘true’ and ‘false’ was able to store in this variable whether or not a message was currently being typed. If the answer to this was ‘true’, the sound would play indefinitely (on a loop_, otherwise, if the variable returned ‘false’, the sound would stop. With this in action, it meant that as soon as the message stopped, so would the audio. Giving a seamless audio clip accompanying every message on screen.

Page 8: Sound game maker explanations
Page 9: Sound game maker explanations

The shoot sound effect for the player was very simple to implement. It was simply a matter of putting the audio action into the left pressed event (I didn’t use ‘released’ this time because I needed the reaction to be instant). As with the shooting sound effect for enemy fire, the sound was so short, I didn’t need to make a stop audio action, and instead just make sure that loop was set to ‘false’.

Page 10: Sound game maker explanations

The ‘Bullet_hit’ sound effect needed to be played whenever it hit an asteroid. As it was only a short instantaneous audio clip, I just needed it to play once, with no need for it to be stopped before it could finish. So I set the loop to false. I put the action for it in the collision event with the player bullet object, as well as with the enemy bullet object – all within the asteroid object’s parent. Putting this event in the parent object, meant that the action would apply for each of the three asteroid types.

Page 11: Sound game maker explanations
Page 12: Sound game maker explanations

As with for the ‘Bullet_hit’ audio clip, everything for this audio clip was done within the asteroid parent object so that it would apply to all three asteroid objects. I put it within a collision event for the player object, so that upon clash with an asteroid, the short sound would play.

Page 13: Sound game maker explanations
Page 14: Sound game maker explanations

The idea of the alarm was to play whenever the health got too low. I wanted it to appear at the same time that the low_health object was created, so all this required was to put the play sound action with the create event of the low_health object, and to put the stop sound at the same place where the low_health object get’s destroyed, so that the two happen almost simultaneously. This time, I set the sound to loop. This is because the sound itself was actually just a single beep, but played over and over gives the impression of an alarm.

Page 15: Sound game maker explanations