mirror of
https://github.com/codeninjasllc/codecombat.git
synced 2025-03-31 07:12:49 -04:00
Fix invalid audio panning values
This commit is contained in:
parent
88d11afb1d
commit
5ba607cac7
1 changed files with 2 additions and 0 deletions
|
@ -62,7 +62,9 @@ class AudioPlayer extends CocoClass
|
|||
sup = @camera.worldToSurface pos
|
||||
svp = @camera.surfaceViewport
|
||||
pan = Math.max -1, Math.min 1, ((sup.x - svp.x) - svp.width / 2) / svp.width
|
||||
pan = 0 if _.isNaN pan
|
||||
dst = @camera.distanceRatioTo pos
|
||||
dst = 0.8 if _.isNaN dst
|
||||
vol = Math.min 1, options.volume / Math.pow (dst + 0.2), 2
|
||||
volume: options.volume, delay: options.delay, pan: pan
|
||||
|
||||
|
|
Loading…
Add table
Reference in a new issue