Undertale script viewer

← back to main script listing

gml_Object_obj_rborder_Step_2

(view raw script w/o annotations or w/e)
1
if (x != global.idealborder[1])
2
{
3
    if (abs(x - global.idealborder[1]) <= 15)
4
        x = global.idealborder[1];
5
    else if (x > global.idealborder[1])
6
        x -= 15;
7
    else
8
        x += 15;
9
}
10
if (y != global.idealborder[3])
11
{
12
    if (abs(y - global.idealborder[3]) <= 15)
13
        y = global.idealborder[3];
14
    else if (y > global.idealborder[3])
15
        y -= 15;
16
    else
17
        y += 15;
18
}
19
size = ceil((global.idealborder[2] - global.idealborder[3]) / 5);
20
if (x == global.idealborder[1] || global.idealborder[2] > (y + (image_yscale * 5)))
21
{
22
    if (image_yscale != size)
23
    {
24
        if (abs(size - image_yscale) <= 3)
25
            image_yscale = size;
26
        if (image_yscale > size)
27
            image_yscale -= 3;
28
        if (image_yscale < size)
29
            image_yscale += 3;
30
    }
31
}
32
y = obj_dborder.y;
33
image_yscale = (obj_uborder.y - obj_dborder.y) / 5;
34
if (instaborder == 1)
35
{
36
    x = global.idealborder[1];
37
    y = global.idealborder[3];
38
    image_yscale = (global.idealborder[2] - global.idealborder[3]) / 5;
39
}