M
Meowanator
Guest
I need to check whenever a sprite's sub-image changes. This is so I can change the music when the background changes. I have it so the background is dependent on one sprite. My code is shown below with the second part being the music code I started adding.
Code:
///Backgrounds
background_visible[1] = false;
background_visible[2] = false;
background_visible[3] = false;
background_visible[4] = false;
background_visible[5] = false;
background_visible[obj_selectable_bkg.image_index+1] = true;
obj_display_manager.bw_shader_enabled = background_visible[5];
audio_stop_all();
switch obj_selectable_bkg.image_index{
case 0: audio_play_sound(snd_vampire_killer,80,true); break;
case 1: audio_play_sound(snd_vampire_killer,80,true); break;
case 2: audio_play_sound(snd_stalker,80,true); break;
case 3: audio_play_sound(snd_wicked_child,80,true); break;
case 4: audio_play_sound(snd_battle_holy,80,true); break;
default: audio_play_sound(snd_vampire_killer,80,true); break;
}