Undertale script viewer

← back to main script listing

gml_Object_obj_mainchara_Collision_10

related scripts: Collision_10 • Collision_11 • Collision_12 • Collision_13 • Collision_1367 • Collision_822 • Create_0 • Draw_0 • KeyPress_118 • KeyPress_120 • KeyPress_121 • KeyPress_122 • KeyPress_123 • KeyPress_33 • KeyPress_34 • KeyPress_35 • KeyPress_36 • KeyPress_45 • KeyPress_46 • KeyPress_48 • KeyPress_49 • KeyPress_50 • KeyPress_51 • KeyPress_52 • KeyPress_53 • KeyPress_54 • KeyPress_71 • KeyPress_73 • KeyPress_77 • KeyPress_79 • KeyPress_80 • KeyPress_85 • Keyboard_76 • Keyboard_83 • Other_10 • Other_12 • Step_0 • Step_2

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