So i have a ton of tracks for my game already (all on my youtube channel)
but the sound system i have right now is hella buggy and doesnt passively play tracks like i need it to.
I need a system that plays a track, then when its done pick an amount of time based on a range to wait before playing the next track, then pick a track randomly from a list of tracks that can play depending on circumstances (time of day/area of map etc)
In short, a passive version (like minecraft) of terraria’s music system.
Can anyone give me any pointers?
EDIT: Tinysound turned out to be perfect and the sound system is now fully functional.
void tick()
{
if (TritonForge.Screen != "Title" && Menu.playing() == true)
{
Menu.stop();
}
if (TritonForge.Screen == "Game")
{
if (music == false)
{
GoodMorning.stop();
May.stop();
timer--;
if (timer <= 0)
{
int i = new Random().nextInt(range) + 1800;
timer = i;
if (Sky.time == Sky.day)
{
int m = new Random().nextInt(5);
if (m == 0){GoodMorning.play(true,musicvol); GoodMorning.setLoop(false);music = true;}
if (m == 1){May.play(true,musicvol); May.setLoop(false);music = true;}
if (m == 2){Sunset.play(true,musicvol); Sunset.setLoop(false);music = true;}
if (m == 3){Winter.play(true,musicvol); Winter.setLoop(false);music = true;}
if (m == 4){Calm.play(true,musicvol); Calm.setLoop(false);music = true;}
}
if (Sky.time == Sky.night)
{
int m = new Random().nextInt(2);
if (m == 0){Sunset.play(true,musicvol); Sunset.setLoop(false);music = true;}
if (m == 1){Dusk.play(true,musicvol); Dusk.setLoop(false);music = true;}
}
}
}
}
System.out.println(timer);
if (GoodMorning.playing() == false &&
May.playing() == false &&
Sunset.playing() == false &&
Winter.playing() == false &&
Calm.playing() == false)
{
music = false;
}
}