Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!
I want to add bright effect to background with music sync. Example: when music reaches 5, 7, 15, 19, 33, 144... seconds, instantly spawn white (0.1 alpha) image and slowly "fade out" it. Is there an easy way to do this?
You can use audio_sound_get_track_position to get the amount of seconda that the track has been playing.
I would use it combined with a set of flags (ex f_5 = true) in order to know if the track had reached the desired position and spawn an object with the white image that slowly fades out.
You can use audio_sound_get_track_position to get the amount of seconda that the track has been playing.
I would use it combined with a set of flags (ex f_5 = true) in order to know if the track had reached the desired position and spawn an object with the white image that slowly fades out.
image_alpha = 0;
//list to hold times where Sprite appears
Time_list = ds_list_create();
ds_list_add(Time_list, 5, 7, 15, 19, 33, 144, 99999);
Part = 0;
Step code:
Code:
//reduce alpha
image_alpha = min(image_alpha - 0.1, 0);
//check if part was reached
if (audio_sound_get_track_position (aMenuMusic) >= Time_list[| Part] )
{
Part += 1;
image_alpha = 1;
}
image_alpha = 0;
//list to hold times where Sprite appears
Time_list = ds_list_create();
ds_list_add(Time_list, 5, 7, 15, 19, 33, 144, 99999);
Part = 0;
Step code:
Code:
//reduce alpha
image_alpha = min(image_alpha - 0.1, 0);
//check if part was reached
if (audio_sound_get_track_position (aMenuMusic) >= Time_list[| Part] )
{
Part += 1;
image_alpha = 1;
}