Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_dw_church_lantern_hallway_Step_2

(view raw script w/o annotations or w/e)
1
if (roomloop)
2
{
3
    var offset = rightx - leftx;
4
    var voffset = heightdiffer;
5
    if (kris.x > rightx)
6
    {
7
        kris.x -= offset;
8
        kris.y += voffset;
9
        with (obj_caterpillarchara)
10
        {
11
            for (var i = 0; i < array_length(remx); i++)
12
            {
13
                remx[i] -= offset;
14
                remy[i] += voffset;
15
            }
16
        }
17
        if (loopcount > 0)
18
            loopcount--;
19
    }
20
    if (kris.x < leftx)
21
    {
22
        loopcount++;
23
        kris.x += offset;
24
        kris.y -= voffset;
25
        with (obj_caterpillarchara)
26
        {
27
            for (var i = 0; i < array_length(remx); i++)
28
            {
29
                remx[i] += offset;
30
                remy[i] -= voffset;
31
            }
32
        }
33
    }
34
}