Deltarune (Chapter 2) script viewer

← back to main script listing

gml_Object_obj_chapter_continue_Step_0

(view raw script w/o annotations or w/e)
1
if (init < 40)
2
{
3
    init++;
4
    text_alpha = clamp(text_alpha + 0.05, 0, 1);
5
    ypos_offset = clamp(ypos_offset - 3, 0, 40);
6
    exit;
7
}
8
if (!confirmed_selection)
9
{
10
    if (up_p())
11
    {
12
        move_noise = true;
13
        choice_index = ((choice_index - 1) < 0) ? 1 : 0;
14
    }
15
    if (down_p())
16
    {
17
        move_noise = true;
18
        choice_index = ((choice_index + 1) > 1) ? 0 : 1;
19
    }
20
    if (button1_p())
21
    {
22
        select_noise = true;
23
        confirmed_selection = true;
24
        alarm[0] = 30;
gml_Object_obj_chapter_continue_Alarm_0.gml

if (choice_index == 0) { var next_chapter = global.chapter + 1; if (global.is_console) { var _loading = instance_create(0, 0, obj_screen_loading); _loading.show_loading_screen(next_chapter, scr_chapterswitch); _loading.depth = -1000; } else { scr_chapterswitch(next_chapter); } } if (choice_index == 1) game_restart_true();
25
    }
26
}
27
if (confirmed_selection)
28
    text_alpha = clamp(text_alpha - 0.5, 0, 1);
29
if (move_noise)
30
{
31
    move_noise = false;
32
    snd_play(snd_menumove);
33
}
34
if (select_noise)
35
{
36
    select_noise = false;
37
    snd_play(snd_select);
38
}