/** * Play a sound only once, and allow it only once every interval. Very useful for sounds made * while enemies are on stage, since it won't play concurrent sounds. * * @param sound * @param volume * @param identifier * @param interval */ public static void playSoundSingle( final Getter<Sound> getter, float volume, String identifier, long interval) { if (!Scheduler.isTracked(identifier, identifier)) { Sound sound = getter.get(); sound.play(volume); Scheduler.track(identifier, identifier, interval); } }