Erekir turret SFX (of varying quality)

This commit is contained in:
Anuken
2022-08-21 20:44:07 -04:00
parent ae83779253
commit 2c28b206b8
19 changed files with 62 additions and 3 deletions

View File

@@ -19,11 +19,15 @@ public class SoundLoop{
}
public void update(float x, float y, boolean play){
update(x, y, play, 1f);
}
public void update(float x, float y, boolean play, float volumeScl){
if(baseVolume <= 0) return;
if(id < 0){
if(play){
id = sound.loop(sound.calcVolume(x, y) * volume * baseVolume, 1f, sound.calcPan(x, y));
id = sound.loop(sound.calcVolume(x, y) * volume * baseVolume * volumeScl, 1f, sound.calcPan(x, y));
}
}else{
//fade the sound in or out
@@ -38,7 +42,7 @@ public class SoundLoop{
}
}
Core.audio.set(id, sound.calcPan(x, y), sound.calcVolume(x, y) * volume * baseVolume);
Core.audio.set(id, sound.calcPan(x, y), sound.calcVolume(x, y) * volume * baseVolume * volumeScl);
}
}