Mail Archives: djgpp/1997/12/22/00:17:37
> My problem is that a lot of events happen, some on the visible area of
> the screen, some others not visible.
> In case of an event how can I decide if I must play the according
> soundeffect (depending on the position of the vehicle in relation to the
> visible area)
My guess would be to see if the explosion is with the screen ie.
if ObjX > ScreenLeft and ObjX < ScreenLeft + ScreenWidth and (Y
tests...)
(play sound)
> How is the volume altered in relation to the distance and position of
> the event.
well, most games just play the sound at a certain loudness if the event
is on the screen, and very faintly otherwise (example: Z) Though, I
suppose teh volume could be scaled using pythagorean distance:
sqr((ObjX-CurX)^2 + (ObjY-CurY)^2) (where CurX/Y are player's position)
then scale that value from your lowest desired volume to your highest,
then
to compute final volume, subtract it from highest desired volume.
> Is it possible to include surround soundeffects?
doubt that it's impossible, I really don't know. But, wouldn't you have
to use stereo wav files?
-Mike
- Raw text -