I tried the following, but not too sure about it.
// Play a random atmosphere sound
if (rand.next(0, 1000) > 995)
atm_snds.playRandomSound();
The problem is that sounds play too frequently, though I just want it every once in a while. Right now I have it set to play one random sound at a time.
It's a 2d game, so performance isn't much of a concern. There's a Timer class, and it can be called with an ellapsed time, though resources are slow, and then check with a random number condition. That's my new idea.
Another idea is to use a counter. If it's past the max, do a condition with a random number. If it passes, then play a random atmosphere sound.
But I'm curious: Is there a preferred way of playing random atmosphere sounds? Thanks.