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.

accordingly. The effect is especially good when you have a good speaker system but is already<br />

works on small speakers.<br />

Besides a position, the sound can also has a velocity. This leads to well-known doppler effects<br />

which are correctly modelled. Finally the sound can have an orientation and, again, the sound<br />

is adapted accordingly.<br />

<strong>Game</strong> <strong>Maker</strong> supports 3D sound options through the functions below. They only work for<br />

sound resources that were indicated to be 3D. (The disadvantage is that 3D sounds will be<br />

mono, not stereo.)<br />

sound_3d_set_sound_position(snd,x,y,z) Sets the position of the<br />

indicated sound <strong>with</strong> respect to the listener to the indicated position in space.<br />

Values on the x-axis increase from left to right, on the y-axis from down to up,<br />

and on the z-axis from near to far. The values are measured in meters. The<br />

volume <strong>with</strong> which the sound is heard depends on this measure in the same<br />

way as in the real world.<br />

sound_3d_set_sound_velocity(snd,x,y,z) Sets the velocity of the<br />

indicated sound to the indicated vector in space. Please note that setting the<br />

velocity does not mean that the position changes. The velocity is only used for<br />

calculating doppler effects. So if you want to move the sound you must<br />

yourself change the position of the sound.<br />

sound_3d_set_sound_distance(snd,mindist,maxdist) Sets the<br />

minimum distance at which the sound does no longer increase in loudness and<br />

the maximum distance at which the sound can no longer be heard. So when<br />

the distance lies between 0 and the minimum distance the sound is at<br />

maximal amplitude. When between the minimal distance and the maximal<br />

distance the amplitude slowly decreases until either the maximal distance is<br />

reached or the sound is anyway no longer audible. Default the minimum<br />

distance is 1 meter and the maximal distance is 1 billion meters.<br />

sound_3d_set_sound_cone(snd,x,y,z,anglein,angleout,voloutsi<br />

de) Normally sound has the same amplitude at a given distance in all<br />

directions. You can set the sound cone to change this and make sound<br />

directional. x,y,z specify the direction of the sound cone. anglein specifies<br />

the inside angle. If the listener is inside this angle it hears the sound at its<br />

normal volume. angleout specifies the outside angle. When the listener is

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

Saved successfully!

Ooh no, something went wrong!