Deltarune (Chapter 4) script viewer

← back to main script listing

gml_Object_obj_jump_arc_Create_0

(view raw script w/o annotations or w/e)
1
master = -1;
2
origx = 0;
3
origy = 0;
4
goalx = 0;
5
goaly = 0;
6
zheight = 0;
7
time = 1;
8
timer = 1;
9
10
jump_start = function()
11
{
12
    _hspeed = (goalx - origx) / time;
13
    _vspeed = (goaly - origy) / time;
14
};
15
16
tick = function()
17
{
18
    if (!i_ex(master))
19
        instance_destroy();
20
    with (master)
21
    {
22
        x += other._hspeed;
23
        y += other._vspeed;
24
        z = sin((pi / other.time) * other.timer) * other.zheight;
25
    }
26
    timer++;
27
    if (timer > time)
28
        instance_destroy();
29
};