Skocz do zawartości

Rekomendowane odpowiedzi

pomużcie mi !!

mam problem z dzwiękiem !

bo chciałbym aby dzwięk się ściszał jak przeciwnik odchodzi odemnie

 

czyli to gracz---> .O. ,().<---to wróg, strzela i wydaje dzwięk :P ale jak się oddali to aby dzwięk strzelania był cichszy. co mam zrobic aby tak było ??? :( :(

Odnośnik do komentarza
Udostępnij na innych stronach

This functionality is only available in the registered version of Game Maker.

3D sounds refers to sound that has a position (and velocity) with respect to the listener. Although its most prominent use is in 3D games you can also effectively use it in 2D games. The idea is that a sound has a position in space. In all functions the listener is assumed to be at position (0,0,0). The system calculates how the listener would hear the sound and adapt it accordingly. The effect is especially good when you have a good speaker system but is already works on small speakers.

 

Besides a position, the sound can also has a velocity. This leads to wellknown doppler effects which are correctly modelled. Finally the sound can have an orientation and, again, the sound is adapted accordingly.

 

Game Maker supports 3D sound options through the functions below. They only work for sound resources that were indicated to be 3D. (The disadvantage is that 3D sounds will be mono, not stereo.)

 

 

sound_3d_set_sound_position(snd,x,y,z) Sets the position of the indicated sound with respect to the listener to the indicated position in space. Values on the x-axis increase from left to right, on the y-axis from down to up, and on the z-axis from near to far. The values are measured in meters. The volume with which the sound is heard depends on this measure in the same way as in the real world.

sound_3d_set_sound_velocity(snd,x,y,z) Sets the velocity of the indicated sound to the indicated vector in space. Please note that setting the velocity does not mean that the position changes. The velocity is only used for calculating doppler effects. So if you want to move the sound you must yourself change the position of the sound.

sound_3d_set_sound_distance(snd,mindist,maxdist) Sets the minimum distance at which the sound does no longer increase in loudness and the maximum distance at which the sound can no longer be heard. So when the distance lies between 0 and the minimum distance the sound is at maximal amplitude. When between the minimal distance and the maximal distance the amplitude slowly decreases until either the maximal distance is reached or the sound is anyway no longer audible. Default the minimum distance is 1 meter and the maximal distance is 1 billion meters.

sound_3d_set_sound_cone(snd,x,y,z,anglein,angleout,voloutside) Normally sound has the same amplitude at a given distance in all directions. You can set the sound cone to change this and make sound directional. x,y,z specify the direction of the sound cone. anglein specifies the inside angle. If the listener is inside this angle it hears the sound at its normal volume. angleout specifies the outside angle. When the listener is outside this the volume is indicated with voloutside. To be precise, voloutside is a negative number that indicates the number of hundreds of decibel that must be subtracted from the inside volume. Between the inside and outside angle the volume gradually decreases.

Czyli teraz trochę ci omówię:

sound_3d_set_sound_position(snd,x,y,z) - tym ustawiasz pozycję dźwięku na podstawie powyższej instrukcji.

sound_3d_set_sound_distance(snd,mindist,maxdist) - tym ustawiasz odległość dźwięku na jaką może się oddalić.

 

Co do tej pozycji dźwięku, to tak możesz ustawić:

sound_3d_set_sound_position(nazwa dzwieku,pocisk.x,pocisk.y,0)
Odnośnik do komentarza
Udostępnij na innych stronach

Jeśli chcesz dodać odpowiedź, zaloguj się lub zarejestruj nowe konto

Jedynie zarejestrowani użytkownicy mogą komentować zawartość tej strony.

Zarejestruj nowe konto

Załóż nowe konto. To bardzo proste!

Zarejestruj się

Zaloguj się

Posiadasz już konto? Zaloguj się poniżej.

Zaloguj się
  • Ostatnio przeglądający   0 użytkowników

    • Brak zarejestrowanych użytkowników przeglądających tę stronę.
×
×
  • Dodaj nową pozycję...