Deltarune (Chapter 5) script viewer

← back to main script listing

gml_GlobalScript_scr_plat_set_difference

(view raw script w/o annotations or w/e)
1
function 
scr_plat_set_difference
scr_plat_set_difference

function
scr_plat_set_difference()
{ switch (dif_type) { case 0: case 1: dif_x = sign(x - xprevious) * max(abs(hspeed), abs(x - xprevious)); dif_y = sign(y - yprevious) * max(abs(vspeed), abs(y - yprevious)); break; } }
()
2
{
3
    switch (dif_type)
4
    {
5
        case 0:
6
        case 1:
7
            dif_x = sign(x - xprevious) * max(abs(hspeed), abs(x - xprevious));
8
            dif_y = sign(y - yprevious) * max(abs(vspeed), abs(y - yprevious));
9
            break;
10
    }
11
}