Deltarune (Chapter 3) script viewer

← back to main script listing

gml_Object_obj_lerpvar_Step_0

(view raw script w/o annotations or w/e)
1
if (i_ex(target))
2
{
3
    if (init == 0)
4
    {
5
        if (is_string(pointa))
6
            pointa = variable_instance_get(target, varname);
7
        init = 1;
8
    }
9
    var cont = 1;
10
    if (respectglobalinteract == true)
11
    {
12
        if (global.interact != 0)
13
            cont = 0;
14
    }
15
    if (cont)
16
        time++;
17
    if (easetype == 0)
18
    {
19
        variable_instance_set(target, varname, lerp(pointa, pointb, time / maxtime));
20
    }
21
    else
22
    {
23
        if (easeinout == "out")
24
            variable_instance_set(target, varname, lerp_ease_out(pointa, pointb, time / maxtime, easetype));
25
        if (easeinout == "in")
26
            variable_instance_set(target, varname, lerp_ease_in(pointa, pointb, time / maxtime, easetype));
27
        if (easeinout == "inout")
28
            variable_instance_set(target, varname, lerp_ease_inout(pointa, pointb, time / maxtime, easetype));
29
    }
30
    if (time >= maxtime)
31
        instance_destroy();
32
}
33
else
34
{
35
    instance_destroy();
36
}