if(!sound_isplaying(yourBGM))
{
sound_stop(otherBGM);
sound_loop(yourBGM);
}
Alright that map is splittible into a sort of grid, I'm working on a quick example that will actively check the imaginary map "grid" it'll check if it changes different types and if so it will then transition the music. I'll prob have the example done in a bit. The grid size would be fully modifiable with a simple variable change.This is similar to an idea i had to basically break up the zone into rectangles and check collisions, but i knew someone had an efficient/not badly-rigged together idea. This helps a lot more than just lots of objects checking music(it would not be a few, you would need lots and the collisions would be weird.) because if i ever need to add anything else based on biomes, such as titles or weather effects or enemy spawns or something this sort of is a check one check all.
//Create the grid
musicGrid=ds_grid_create(room_width,room_height)
//This part will require some thought.
for(iX=0;iX<=room_width;iX+=1)
{
for(iY=0;iY<=room_height;iY+=1)
{
ds_grid_set(musicGrid,iX,iY,"bgmForest");
}
}
//In Link's step event.
//This bottom part should work in theory, if not some IF THEN ELSE will do, that may give you more control over the fading.
sound_play(ds_grid_get(musicGrid,Link.x,Link.y));