Issues in the Philippines (Unemployment and Underemployment).pptx
Programming my sounds into my game
1. Michael Hughes 02/06/2015
Programming My Sounds into my Game
In orderto program soundsinto mygame,I firstneededtoaddthe soundfilestomygame maker
project.Thisisdone by rightclickingthe “Sounds”Assetfolderonthe lefthandside thenclickingthe
“Create Sound”Option,itthenopensa popup window thatallowsyoutoimport.WAV or .MP3
soundfilestogamemaker.Italsoletsyouselectaname for the sound,Control the Volume andEdit
the soundif you have the neccassary external software. Otheroptionsthatcan be changedare also
the Attributes like UncompressedorCompressed –Streamed. Aswell asthe Bitrate,Sample rate,
either8 or 16 bitand the device the soundsare playingfromforinstance monoandstereo. After
checkingall of these settings,Ithenwentontobrowse mysoundlibraryfor eachfile.
Selecting the sounds
To program my soundsintomygame,I wasrequiredto browse eachof the soundassetsI had
gathered,todo thisI navigatedtomyREAPER mediafoldertofindthe soundsIhave downloaded.I
thenplayedeachof the soundsto ensure theyworkedingamemakerandputthemintothe
“Sounds”Folderbyclicking“OK”.
2. Michael Hughes 02/06/2015
Programming the sounds into my game
To actuallymake the soundswork,I wasrequiredtouse a line of code to make sure theyplayed
whenI wantedthemtoo,Ibeganusingthe mainmusic forthe game,I decidedtoplace thisinthe
PlayerCreate Eventbecause whenthe playeriscreated,itwill playthe musicforthe game
automatically.
The line of code is: audio_play_sound(soundID,Priority,loop); “soundID”“Priority”and
“loop”can be changedaround.
Thisis the methodthatplays
the sound,ittellsthe game
to playthissoundwhenever
the eventistriggered,for
instance inmygame,I made
the code triggerwhenthe
playeriscreated.
The “soundID”is the
name of the sound,so
whateverthe soundwas
namedwhenIselected
themiswhat wentin
here,inthiscase
“Game_Theme_level_1”
was the soundIDbecause
that iswhat itis called.
The priorityissetto a
number,itisn’t as
importantas the other
variablesbutitisstill
useful,dependingonhow
highthe numberis,this
soundwouldtake priority
overothersoundswith
lowernumbers.
Thisis either“true”or
“false”andthis
determineswhetherthe
soundwill playagain
once it finishes.
3. Michael Hughes 02/06/2015
I used this piece of code for every single sound, although I put them in
different places so they would work. I repeated this process so I added a
total of 4 sounds into my game.
Jumping Sound
Next level Sound
Game over Sound