Undertale script viewer

← back to main script listing

gml_Object_obj_hotdog_Step_2

(view raw script w/o annotations or w/e)
1
if (on == 1)
2
{
3
    if (parent.x != parent.xprevious)
4
    {
5
        hspeed = parent.x - parent.xprevious;
6
        if (hspeed > 0)
7
            hspeed += friction;
8
        if (hspeed < 0)
9
            hspeed -= friction;
10
    }
11
    y = parent.y - relative;
12
}
13
if (x < (parent.x - 2) && on == 1)
14
{
15
    on = 0;
16
    hspeed = -4;
17
    fall = 1;
18
    g = instance_create(x, y, obj_failuredog);
19
    g.fally = parent.y + 30;
20
    g.fall = fall;
21
    g.friction = friction;
22
    g.hspeed = hspeed;
23
    instance_destroy();
24
}
25
if (x > (parent.x + 18) && on == 1)
26
{
27
    hspeed = 4;
28
    on = 0;
29
    fall = 6;
30
    g = instance_create(x, y, obj_failuredog);
31
    g.friction = friction;
32
    g.fally = parent.y + 30;
33
    g.fall = fall;
34
    g.hspeed = hspeed;
35
    instance_destroy();
36
}