Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP

Loading…

fix for issue #228 regarding FlxSound.proximity #229

Open
wants to merge 2 commits into from

1 participant

Thomas van den Berg
Thomas van den Berg

This fixes an issue causing sound volume to be computed as a linear function of distance, in stead of decreasing with increasing distance.

FlixelCommunityBot FlixelCommunityBot referenced this pull request in FlixelCommunity/flixel
Closed

fix for issue #228 regarding FlxSound.proximity #3

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on May 15, 2012
  1. Thomas van den Berg
Commits on Jun 7, 2012
  1. Thomas van den Berg

    further sound fixes

    noio authored
This page is out of date. Refresh to see the latest.
Showing with 3 additions and 3 deletions.
  1. +3 −3 org/flixel/FlxSound.as
6 org/flixel/FlxSound.as
View
@@ -182,7 +182,7 @@ package org.flixel
if(_position != 0)
return;
- var radial:Number = 1.0;
+ var radial:Number = 0.0;
var fade:Number = 1.0;
//Distance-based volume control
@@ -194,7 +194,7 @@ package org.flixel
if(_pan)
{
- var d:Number = (_target.x-x)/_radius;
+ var d:Number = (x - _target.x)/_radius;
if(d < -1) d = -1;
else if(d > 1) d = 1;
_transform.pan = d;
@@ -223,7 +223,7 @@ package org.flixel
fade = 1 - fade;
}
- _volumeAdjust = radial*fade;
+ _volumeAdjust = (1 - radial) * fade;
updateTransform();
if((_transform.volume > 0) && (_channel != null))
Something went wrong with that request. Please try again.