Deltarune (Chapter 1) 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
}
7
if (!confirmed_selection)
8
{
9
    if (up_p())
10
    {
11
        move_noise = true;
12
        choice_index = ((choice_index - 1) < 0) ? 1 : 0;
13
    }
14
    if (down_p())
15
    {
16
        move_noise = true;
17
        choice_index = ((choice_index + 1) > 1) ? 0 : 1;
18
    }
19
    if (button1_p())
20
    {
21
        select_noise = true;
22
        confirmed_selection = true;
23
        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();
24
    }
25
}
26
if (confirmed_selection)
27
    text_alpha = clamp(text_alpha - 0.5, 0, 1);
28
if (move_noise)
29
{
30
    move_noise = false;
31
    snd_play(snd_menumove);
32
}
33
if (select_noise)
34
{
35
    select_noise = false;
36
    snd_play(snd_select);
37
}