Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_board_b2drawbridge_Step_0

(view raw script w/o annotations or w/e)
1
if (active)
2
{
3
    if (visitinit == 0 && obj_board_camera.con == 0)
4
    {
5
        var open = false;
6
        with (obj_mainchara_board)
7
        {
8
            if (boat == true)
9
                open = true;
10
        }
11
        if (open)
12
            depth = 100000;
13
        else
14
            depth = 999990;
15
        if (image_index == 0)
16
        {
17
            if (open == true)
18
            {
19
                doopen = true;
20
                doclose = false;
21
            }
22
        }
23
        else if (open == false)
24
        {
25
            doopen = false;
26
            doclose = true;
27
        }
28
        visitinit = 1;
29
    }
30
}
31
else
32
{
33
    visitinit = 0;
34
}
35
if (doopen)
36
{
37
    if (image_index < 3)
38
    {
39
        image_index += 0.25;
40
        if (image_index >= 3)
41
        {
42
            snd_play(snd_board_door_close);
43
            image_index = 3;
44
            doopen = false;
45
        }
46
    }
47
}
48
if (doclose)
49
{
50
    if (image_index > 0)
51
    {
52
        image_index -= 0.25;
53
        if (image_index < 1)
54
        {
55
            snd_play(snd_board_splash);
56
            image_index = 0;
57
            doclose = false;
58
        }
59
    }
60
}
61
image_index = clamp(image_index, 0, 3);