Undertale Yellow script viewer

← back to main script listing

gml_Object_obj_dunes_35b_dynamic_music_Step_0

(view raw script w/o annotations or w/e)
1
if (obj_pl.x < 140 && current_mus == 0)
2
{
3
    current_mus = 1
4
    if audio_is_playing(mus_cafe_arcade)
5
    {
6
        audio_sound_gain(mus_cafe_arcade, 1, 600)
7
        audio_sound_gain(obj_radio.current_song, 0, 600)
8
        return;
9
    }
10
    var dynamic_mus = audio_play_sound(mus_cafe_arcade, 1, 1)
11
    audio_sound_gain(dynamic_mus, 0, 0)
12
    var dynamic_mus_pos = audio_sound_get_track_position(obj_radio.current_song)
13
    audio_sound_set_track_position(dynamic_mus, dynamic_mus_pos)
14
    audio_sound_gain(obj_radio.current_song, 0, 600)
15
    audio_sound_gain(dynamic_mus, 1, 600)
16
}
17
else if (obj_pl.x >= 140 && current_mus == 1)
18
{
19
    current_mus = 0
20
    scr_audio_fade_out
scr_audio_fade_out

function scr_audio_fade_out(argument0, argument1) //gml_Script_scr_audio_fade_out { var snd = argument0 var fade_len = argument1 if (!audio_is_playing(snd)) return false; audio_sound_gain(snd, 0, fade_len) if instance_exists(obj_audio_fade_helper) { with (obj_audio_fade_helper) { if (audio_to_fade == snd) return false; } } with (instance_create(0, 0, obj_audio_fade_helper)) audio_to_fade = snd }
(mus_cafe_arcade, 600)
21
    audio_sound_gain(obj_radio.current_song, 1, 300)
22
}