I'm rather new to Coding, and so far i've managed to figure out quite a bit from Byond's forums and Developer's guides. However i have one issue.
I'm trying to make a Stereo in a game that'll play Music.
I'm wanting to make it so that as you walk away from it, the quieter it gets until you can't hear it at all.
But as you walk towards it, the louder it gets.
I however have no clue how to do this at all, no place to start with.
Anyway this can be done?
if so, mind giving me the code for it?
ID:1928527
Aug 31 2015, 5:41 pm
|
|
Koil's Soundmob library can do this as well as 3D sound positioning. It is featured in Pondera.
|
I made a quick demo to demonstrate how simple it is to use 3D sounds: http://puu.sh/kvgFb/36e6e73b36.zip
Run the project and click around and listen to the differences in how loud each speaker plays the sound (only really works if you have multiple speakers). The core of it is these lines: var sound:s = sound('Laser_Shoot5.wav') In a sidescroller perspective, you'd use sound.y instead of sound.z. The difference is in the DM Reference: positive y is above your head, while positive z is straight ahead. |
Feel free to scavenge up this bit of code.