Deltarune (Chapter 2) script viewer

← back to main script listing

gml_GlobalScript_scr_rotatevector

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

function scr_rotatevector(arg0, arg1, arg2) { var _tempVector = { x: arg0, y: arg1 }; if (arg2 == 0) return _tempVector; var _dir = point_direction(0, 0, arg0, arg1); var _len = point_distance(0, 0, arg0, arg1); _tempVector.x = lengthdir_x(_len, _dir + arg2); _tempVector.y = lengthdir_y(_len, _dir + arg2); return _tempVector; }
(arg0, arg1, arg2)
2
{
3
    var _tempVector = 
4
    {
5
        x: arg0,
6
        y: arg1
7
    };
8
    if (arg2 == 0)
9
        return _tempVector;
10
    var _dir = point_direction(0, 0, arg0, arg1);
11
    var _len = point_distance(0, 0, arg0, arg1);
12
    _tempVector.x = lengthdir_x(_len, _dir + arg2);
13
    _tempVector.y = lengthdir_y(_len, _dir + arg2);
14
    return _tempVector;
15
}