Kisan Call Centre - To harness potential of ICT in Agriculture by answer farm...
Program sounds into game maker game
1. BenAtherton
Programming sounds into my game
To programme sounds into my game first I went into game maker and right click on the
sounds folder and clicked create sound
Doing this opens a window in which I name my sound the first sound I will be making is the
jump sound so I named it accordingly
I then clicked the folder next to the name and went and found my jump sound
2. BenAtherton
I then double clicked the jump sound and went back to the main sound window I decided to
keep the audio uncompressed as this is better for performance and the game is only small
so the extra size shouldn’t matter too much I then pressed ok and the sound was added into
my sound library
Next to add this into the game I had to go into my player object and went to the press space
event this as this is where the player jumps I then added in the play sound option from the
side panel under main 1 and it gives me the below menu
For this menu all I need to do is select the jump sound that I had just added and because
this is a sound that should only play once and then stop I chose for the loop to be on false so
3. BenAtherton
once it’s played it won’t play again unless space is pressed I then pressed okay and went in
game to test if my sound worked I pressed space and the sound played as my character
jumped meaning that it worked
Next I added in the sound for where the player kills an enemy to do this I added the sound
in the same way I did before and this time went into the enemy code and went onto the
collision with player event and added in the sound exactly the same as before making it not
loop as the enemy should only make a death sound once
Next I wanted to add in music so I added the music sound in the same way as previously
however I needed to make a new object for this as this needs to be persistent within the
game so I created a new object called systemand added a create event that played the
sound and this time I put the sound on loop as this is music so I don’t want it to just abruptly
end while someone is playing the game
I then went into the room for my game and added in the system in the corner this means
4. BenAtherton
that as long as this object exists within the room the sound will play and because there is no
way for the object to be destroyed the music will always play as long as the player has been
within this room
Next I moved on to doing the menu sounds I started with the sound for when the play game
button was pressed so I added the sound as shown previously and then went into the object
for the play game text and added playing the sound onto the event that takes you to the
next room
So now when the button is pressed it will play a sound and send you to the next room
5. BenAtherton
Finally I added in the menu music I added this onto the play game object as this object was
always going to be persistent within the menu to do this I added a create event and put to
play the menu sound onto the create event and put it on loop so that it constantly plays the
music I then added a piece of sound to stop this sound when the button is pressed so that
two pieces of music weren’t playing as the same time as sounds will carry over through
rooms unless you tell them otherwise
After that all my sounds had been added into my game I played the game to test if they all
worked and they did so I knew there was no need to go back and change anything and the
task had been completed