Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_homealone_pushable_Step_0

(view raw script w/o annotations or w/e)
1
if (collision_rectangle(x, y, x + sprite_width + 1, y + sprite_height, obj_solidblock, false, true))
2
{
3
    can_push = false;
4
    var _px = 1;
5
    i = _px;
6
    while (i >= 0)
7
    {
8
        if (!place_meeting(x + i, y, obj_solidblock))
9
        {
10
            _px = i;
11
            break;
12
        }
13
        i -= 0.1;
14
    }
15
    x += _px;
16
}
17
if (interact_event)
18
{
19
    interact_event = false;
20
    interacting = true;
21
    event_user(0);
22
}
23
if (auto_depth)
24
    
scr_depth
scr_depth

function
scr_depth(arg0 = id, arg1 = 0)
{ with (arg0) depth = 100000 - ((y * 10) + (sprite_height * 10) + (arg1 * 10)); }
();