Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_shakeobj_ext_Step_0

(view raw script w/o annotations or w/e)
1
if (active == 0)
2
    instance_destroy();
3
if (active == 1)
4
{
5
    if (i_ex(target))
6
    {
7
        timer++;
8
        if (timer >= shakespeed)
9
        {
10
            shakexamt -= shakereduct;
11
            shakeyamt -= shakereduct;
12
            on *= -1;
13
            if (shakexamt < 0)
14
                shakexamt = 0;
15
            if (shakeyamt < 0)
16
                shakeyamt = 0;
17
            target.x = nowx + (shakexamt * on);
18
            target.y = nowy + (shakeyamt * on);
19
            if (shakexamt <= 0 && shakeyamt <= 0)
20
                instance_destroy();
21
            timer = 0;
22
        }
23
    }
24
    else
25
    {
26
        instance_destroy();
27
    }
28
}