More sound fixes

This commit is contained in:
Anuken
2020-11-08 16:40:32 -05:00
parent 7bb23c3384
commit 28dfe2b1f7
6 changed files with 23 additions and 6 deletions

View File

@@ -18,11 +18,12 @@ public class SoundLoop{
}
public void update(float x, float y, boolean play){
if(baseVolume < 0) return;
if(baseVolume <= 0) return;
if(id < 0){
if(play){
id = sound.loop(sound.calcVolume(x, y) * volume * baseVolume, 1f, sound.calcPan(x, y));
Log.info("playing, id = @", id);
}
}else{
//fade the sound in or out
@@ -36,6 +37,7 @@ public class SoundLoop{
return;
}
}
sound.setPan(id, sound.calcPan(x, y), sound.calcVolume(x, y) * volume * baseVolume);
}
}