| 1 | if (live_call()) | 
    
    
        | 2 |     return global.live_result; | 
    
    
        | 3 | if (fade_out == true) | 
    
    
        | 4 | { | 
    
    
        | 5 |     if (draw_alpha > 0.01) | 
    
    
        | 6 |         draw_alpha = lerp(draw_alpha, 0, 0.1); | 
    
    
        | 7 |     else | 
    
    
        | 8 |         instance_destroy(); | 
    
    
        | 9 |     exit; | 
    
    
        | 10 | } | 
    
    
        | 11 | if (draw_alpha < 0.99) | 
    
    
        | 12 | { | 
    
    
        | 13 |     draw_alpha = lerp(draw_alpha, 1, 0.1); | 
    
    
        | 14 | } | 
    
    
        | 15 | else if (puzzle_draw_guide == true) | 
    
    
        | 16 | { | 
    
    
        | 17 |     if (keyboard_multicheck_pressed(0) || keyboard_multicheck_pressed(1)) | 
    
    
        | 18 |         puzzle_draw_guide = false; | 
    
    
        | 19 |     exit; | 
    
    
        | 20 | } | 
    
    
        | 21 | else if (puzzle_start_noloop == false) | 
    
    
        | 22 | { | 
    
    
        | 23 |     alarm[0] = 15;gml_Object_obj_chem_05_maze_puzzle_Alarm_0.gmlif (live_call())
    return global.live_result;
countdown_current -= 1;
if (countdown_current > 0)
{
    audio_play_sound(snd_chem_countdown, 1, 0);
alarm[0] = 30; 
}
else
{
    if (puzzle_music == 0)
    {
        puzzle_music = audio_play_sound(mus_mixin_it_up, 1, 1);
        audio_sound_pitch(puzzle_music, 1);
        if (global.route == 3)
        {
alarm[4] = irandom_range(60, 120); 
            audio_sound_pitch(puzzle_music, random_range(0.75, 1.25));
        }
    }
    audio_play_sound(snd_chem_go, 1, 0);
    draw_puzzle_layer = true;
alarm[1] = 30; 
} | 
    
    
        | 24 |     draw_alpha = 1; | 
    
    
        | 25 |     puzzle_start_noloop = true; | 
    
    
        | 26 | } | 
    
    
        | 27 | if (puzzle_game_victory == true) | 
    
    
        | 28 | { | 
    
    
        | 29 |     if (!alarm[2]) | 
    
    
        | 30 |         alarm[2] = 45; | 
    
    
        | 31 |     puzzle_alpha = 0.5; | 
    
    
        | 32 |     exit; | 
    
    
        | 33 | } | 
    
    
        | 34 | if (puzzle_game_over == true) | 
    
    
        | 35 | { | 
    
    
        | 36 |     event_user(0); | 
    
    
        | 37 |     offset_max = 3; | 
    
    
        | 38 |     puzzle_alpha = 0.5; | 
    
    
        | 39 |     puzzle_game_over = false; | 
    
    
        | 40 |     screenshake_enabled = true; | 
    
    
        | 41 | } | 
    
    
        | 42 | if (global.route == 3) | 
    
    
        | 43 | { | 
    
    
        | 44 |     if (instance_exists(obj_chem_05_maze_puzzle_player) && obj_chem_05_maze_puzzle_player.can_move) | 
    
    
        | 45 |     { | 
    
    
        | 46 |         if (puzzle_speed_last == 0) | 
    
    
        | 47 |             puzzle_speed_last = obj_chem_05_maze_puzzle_player.max_speed; | 
    
    
        | 48 |         if (!alarm[5]) | 
    
    
        | 49 |         { | 
    
    
        | 50 |             if (irandom(pseudo_random_number) == 1) | 
    
    
        | 51 |             { | 
    
    
        | 52 |                 pseudo_random_number = pseudo_random_number_max; | 
    
    
        | 53 |                 puzzle_alpha = random_range(0.25, 0.5); | 
    
    
        | 54 |                 audio_play_sound(272, 1, 0, 1, 0, random_range(0.75, 1.25)); | 
    
    
        | 55 |                 alarm[5] = irandom_range(15, 25); | 
    
    
        | 56 |             } | 
    
    
        | 57 |             else if (pseudo_random_number > 20) | 
    
    
        | 58 |             { | 
    
    
        | 59 |                 pseudo_random_number--; | 
    
    
        | 60 |             } | 
    
    
        | 61 |         } | 
    
    
        | 62 |     } | 
    
    
        | 63 | } | 
    
    
        | 64 | if (screenshake_enabled == true) | 
    
    
        | 65 | { | 
    
    
        | 66 |     x_offset = random_range(-offset_max, offset_max); | 
    
    
        | 67 |     y_offset = random_range(-offset_max, offset_max); | 
    
    
        | 68 |     if (offset_max > 0) | 
    
    
        | 69 |         offset_max -= 0.2; | 
    
    
        | 70 |     else | 
    
    
        | 71 |         screenshake_enabled = 0; | 
    
    
        | 72 | } |