Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_train_switch_Step_2

(view raw script w/o annotations or w/e)
1
if (pressed == 0)
2
{
3
    if (place_meeting(x, y, obj_homealone_heart))
4
    {
5
        snd_play_pitch(snd_noise, 1.2);
6
        pressed = 1;
7
    }
8
}
9
else if (pressed == 1)
10
{
11
    with (obj_train_controller)
12
    {
13
        if (extflag == other.extflag)
14
            active = true;
15
    }
16
    pressed = 2;
17
}
18
else if (pressed == 2)
19
{
20
    if (!place_meeting(x, y, obj_homealone_heart))
21
    {
22
        snd_play_pitch(snd_noise, 0.8);
23
        pressed = 0;
24
    }
25
}
26
if (pressed == 0)
27
    image_index = 0;
28
else
29
    image_index = 1;