Undertale script viewer

← back to main script listing

gml_Object_obj_mainchara_Collision_11

(view raw script w/o annotations or w/e)
1
if (global.phasing == 0 && global.interact == 0)
2
{
3
    if (global.facing == 3)
4
    {
5
        if (collision_point(bbox_left - 2, bbox_top - 2, obj_solidparent, 0, 1) == -4)
6
        {
7
            x = xprevious - 3;
8
            y = yprevious - 3;
9
        }
10
        else
11
        {
12
            x = xprevious;
13
        }
14
    }
15
    if (global.facing == 0)
16
    {
17
        if (collision_point(bbox_right + 3, bbox_bottom + 3, obj_solidparent, 0, 1) == -4)
18
        {
19
            x = xprevious + 3;
20
            y = yprevious + 3;
21
        }
22
        else
23
        {
24
            y = yprevious;
25
        }
26
    }
27
    if (global.facing == 2)
28
    {
29
        x = xprevious;
30
        y = yprevious - 3;
31
    }
32
    if (global.facing == 1)
33
    {
34
        y = yprevious;
35
        x = xprevious + 3;
36
    }
37
    if (obj_time.down && obj_time.left)
38
    {
39
        x = xprevious;
40
        y = yprevious;
41
    }
42
    moving = 0;
43
    if ((x % 3) != 0)
44
        x += 1;
45
    if ((y % 3) != 0)
46
        y -= 1;
47
}
48
if (global.interact == 5 || global.interact == 1 || (global.interact == 3 && global.phasing == 0))
49
{
50
    x = xprevious;
51
    y = yprevious;
52
}