Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix for issue #228 regarding FlxSound.proximity #229

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions org/flixel/FlxSound.as
Original file line number Original file line Diff line number Diff line change
Expand Up @@ -182,7 +182,7 @@ package org.flixel
if(_position != 0) if(_position != 0)
return; return;


var radial:Number = 1.0; var radial:Number = 0.0;
var fade:Number = 1.0; var fade:Number = 1.0;


//Distance-based volume control //Distance-based volume control
Expand All @@ -194,7 +194,7 @@ package org.flixel


if(_pan) if(_pan)
{ {
var d:Number = (_target.x-x)/_radius; var d:Number = (x - _target.x)/_radius;
if(d < -1) d = -1; if(d < -1) d = -1;
else if(d > 1) d = 1; else if(d > 1) d = 1;
_transform.pan = d; _transform.pan = d;
Expand Down Expand Up @@ -223,7 +223,7 @@ package org.flixel
fade = 1 - fade; fade = 1 - fade;
} }


_volumeAdjust = radial*fade; _volumeAdjust = (1 - radial) * fade;
updateTransform(); updateTransform();


if((_transform.volume > 0) && (_channel != null)) if((_transform.volume > 0) && (_channel != null))
Expand Down