08.11.2012 Views

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

Designing Games with Game Maker - YoYo Games

SHOW MORE
SHOW LESS

Create successful ePaper yourself

Turn your PDF publications into a flip-book with our unique Google optimized e-Paper software.

sound_volume(index,value) Changes the volume for the indicated sound<br />

(0 = low, 1 = high).<br />

sound_global_volume(value) Changes the global volume for all sounds (0<br />

= low, 1 = high).<br />

sound_fade(index,value,time) Changes the volume for the indicated<br />

sound to the new value(0 = low, 1 = high) during the indicated time (in<br />

milliseconds). This can be used to fade out or fade in music.<br />

sound_pan(index,value) Changes the pan for the indicated sound (-1 =<br />

left, 0 = center, 1 = right).<br />

sound_background_tempo(factor) Changes the tempo of the background<br />

music (if it is a midi file). factor indicates the factor <strong>with</strong> which to multiply<br />

the tempo. So a value of 1 corresponds to the normal tempo. Larger values<br />

correspond to a faster tempo, smaller values to a slower tempo. Must lie<br />

between 0.01 and 100.<br />

Besides midi and wave files (and mp3 file) there is actually a fourth type of file that can be<br />

played: direct music files. These have the extension .sgt. Such files though often refer to other<br />

files describing e.g. band or style information. To find these files, the sound system must<br />

know where they are located. To this end you can use the following functions to set the search<br />

directory for files. Note though that you must add the files yourself. <strong>Game</strong> <strong>Maker</strong> does not<br />

automatically include such additional files.<br />

sound_set_search_directory(dir) Sets the directory in which direct<br />

music files are to be found. The dir string should not incluce the final<br />

backslash.<br />

Sound effects<br />

This functionality is only available in the Pro Edition of <strong>Game</strong> <strong>Maker</strong>.<br />

Sound effects can be used to change the way sounds and background music sounds. Realize<br />

that sound effects only apply to wave files and midi files, not to mp3 files. This section<br />

describes the functions that exist for using and changing sound effects. Realize that to use<br />

these functions you need to have a good understanding of how sound and synthesizers work.<br />

No explanation of the different parameters is given here. Search the web or books for further<br />

informations.

Hooray! Your file is uploaded and ready to be published.

Saved successfully!

Ooh no, something went wrong!