View Single Post
Old
zero00
Senior Member
 
zero00's Avatar
 
Status: Offline
Posts: 300
Join Date: Oct 2009
Default 08-05-2011, 11:37 AM

I did an experiment like that once. I'll post it when I find it.

Edit: I can't find it. Perhaps this will help?

To change volume while the sound is playing:
  1. Set the volume of sound you're playing to a variable (VolumeLevel = World.SoundVolume, for example)
  2. As the sound plays, you can change the variable and the volume will change accordingly (If you set "SoundVolume" to 0.5, the sound will play at half its volume)

As for changing volume based on range
, multiply that "SoundVolume" variable by a percentage of how close you are to something. If you're 50% within range, multiply the variable by 0.5 (or 0.25 if you're 75% away from the object)


==============Some of my Games and Ideas===========

Sky Warrior: http://www.alice.org/community/showthread.php?t=6291
Health Bars: http://www.alice.org/community/showthread.php?p=36968#post36968
Sky Warrior: Dual Force: http://www.alice.org/community/showthread.php?t=7174

Want to make your own space game? http://www.alice.org/community/showthread.php?t=6389

Last edited by zero00; 08-05-2011 at 11:53 AM.
   
Reply With Quote