Here's the setup:
I have a player sprite and an 'emitter' sprite, what I want to happen is when the player gets within a range of say 600 px of the emitter, I want the engine to play and loop an audio file.
I want the volume of the audio file to increase to a maximum of 0db and to a minimum of -20 dependant on the proximity of the player sprite to the emitter sprite.
When the player is out of the range of the emitter, I want the engine to stop playing the audio file.
I can do most of this myself but I can't work out how to set up the variables and limk them with the volume of the audio file and to clamp the min / max range of said audio file.
Any help will be appriciated.