Unit 73- Criteria 4: Programming Sounds Into a Video Game.
1. Unit 73 Criteria 4: Programming Created Sounds Into A Game.
First, open GameMaker and open a new project.
2. Open the game project you wish to add sounds to. First I am going
to add a shooting sound to my game, so when I click space bar to
shoot, the game with automatically play a chosen sound.
3. Once it loads and is finished and open, Click on ‘Create New Sound’ at the top of the
screen. This is going to be my sound.
4. Once this menu loads, Rename the sound to something relevant to what the purpose of the
sound is going to be, make sure it is a clear, simple name so you will remember what it does.
I am going to call it ‘Shoot_Noise’ Now click ‘Load Sound’ and find your chosen sound.
5. Click ok when you are happy with the chosen sound, and sound name. If
it is for background music, be sure to mark the ‘Background Music’ tab. I
am happy with my chosen settings, so I will click ok.
6. It will create a new Sound in the drop down ‘Sound’ menu. This will now be used to create the
in game sound, or sounds. See how it shows the name you chose? That is why it is important
to name it something simple, as when you start to add lots of sounds it could get confusing.
7. Now, I'm going to click on the main player controller, the object that is wanting to shoot. I am
going to right click, and click on ‘Properties’.
8. When the new menu comes up, you want to click ‘Add Event’, and chose
the command that best suits your game. For me, Space Bar is shoot, so
when Space Bar is pressed, my sound will play.
9. Once you have the right command, now we are going to chose what action you want to
take place when the command is used. I am going to click on ‘Play sound’ so when I click
the space bar, the sound of my choice, out of the drop down menu will play.
10. Right click on the action, and click ‘Edit Values’. A new menu
should appear, asking us which sound we want to be played when
the command is used.
11. We are going to click the little icon next to the menu, and chose our sound, again, this is
why simple names are important for your sounds/ objects. I am going to chose the
‘Shoot_Noise’ Sound out of the menu.
12. Once that is complete, hover over the action to make sure it all looks ok, before clicking
ok, and Running the game to test your new sound(s).
13. I ran my game in normal mode, and the sounds worked perfectly
without problems. When I pressed Space Bar, the sound played, and
the character shot.
14. Next we are going to add a new sound like we did earlier, but with a different sound
file and name, for when the bullet, hits the enemy. Due to the fact that my game
being set in space, and my character is in a space ship, I went for a futuristic noise
to keep with the feel of the game. I named the sound ‘Rock_Hit’. Again, a simple
name.
15. Once done and your sound shows in the dropdown menu like earlier, you are going to right
click your bullet object. Click ‘Properties’ and once again create an event. I am going to choose
‘Collision’. I am going to link it to the enemy Parent object, in my case, the big Meteorite. This
means when the bullet hits the object when playing, I can make it do anything I want. I want it
to play the new sound I have just added, so again, ‘Play sound’ and click on the new sound.
16. This is me choosing the correct sound from the menu.
17. Again, hover over the action and event to double check what you have done looks
alright, before clicking ok, and running the game to test the sound.
18. Now run the game and check your work is correct and working, if
not, double check what changes you made to make sure everything
is in place.
19. Now we are going to add a background music onto our game. First find your
background music sound from the ‘create sound’ option like earlier.
20. Here is me choosing my background music for my game. Do not forget to tick the
‘Background Music’ box before clicking ok.
21. Be sure to save regularly to avoid any work loss if anything goes astray.
22. Again, create another new sound, and name it something along the lines of ‘Start’. I am
now adding a quick noise indicating the start of the game, to warn players that the game is
about to begin.
23. Click on the main character object again, and add a ‘Create’ event. Then
drag ‘Play sound into the side box, choose your new sound, and click ok.
24. Once again, run your game to check if your work, actually works!
25. For the last time, create a new sound, and name it something along the lines of
‘Destroy’ for when the meteorites get destroyed. Click create sound, choose the
sound you wish to use, and click ok.
26. What we need to do now, is click on the meteorite objects, and create a new
event, for when the meteorites are destroyed. Click on ‘Play sound’ again, and add in
the sound you want to use. Again, double check the work before clicking ok, and
checking your work.
27. When you run the game, you should have a game, will sounds that
automatically play when you shoot, hit objects, destroy objects, start
the game, and even background music